How to bind a key in batch? [closed] - batch-file

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 years ago.
Improve this question
I wanted to know if it was possible to bind key to execute a command but while the .bat file is minimized.
Any ideas?
I have searched everywhere but I have found nothing, the only thing I found was "choice" which is something I am not trying to do.
I know that this is possible because I have a file that does it, sadly it is not mine and it was converted to a .exe file so I don't know how to convert it back to a .bat file to be able to look into the code and find my answer.

There are two types of hotkeys in Windows. One to activate an open window (set when window is created) and one that sends a message key pressed to a window (set by a program anytime).
On Windows shortcuts (ie lnk files not keyboard shortcuts) there is an option to set a hotkey. If the program is not running then windows' explorer registers it to itself and starts the program in the shortcut, if the program is running activates the window.

Related

Custom font in batch file [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 1 year ago.
Improve this question
I am currently making a Text user interface/TUI in batch. I want the font in the command prompt (console) to be exactly the same as the default Windows font, and I wish to do it without making registry changes. Is this possible?
(I can't give debug details right now, sorry about that.)
According to this website the default Windows 10 font is Segeo UI. I couldn't find a way to set this as the font used in the basic command prompt, as it seems to be restricted to a set amount of fonts, however the new Windows Terminal which can be downloaded from the Windows Store allows you to.
You simply press ctrl + , to open settings, go down to the Command Prompt profile on the left hand side, then go to appearance, and click show all fonts
Once you've clicked that, open the fonts dropdown and you'll find Segeo UI in the menu
Then just click save, and job done!

Im making a bat file ment to be opened with another file how would i get the file? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
I am going to make a code that I open with another file through the operating system i will do so by right clicking it and clicking open with then selecting my code this code will be a bat file and i need to get the path of the file it was opened with so is there a way i could do this and if so how would I? I'm compiling my go code files with this so the code should look something like this
set file = (Gets the file and path here)
go run file
is this even possible? and if i need to do this in another language what would that be
I fortunately enough found my answer so this is the code to run.
#echo off
echo %1
cmd /k

CanĀ“t run .bat file under windows 10 [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 years ago.
The community reviewed whether to reopen this question 9 months ago and left it closed:
Original close reason(s) were not resolved
Improve this question
I have few .bat files that I used under Windows XP. Now I want to use them under Windows 10, but when I run one of the files (even as administrator) it shows the command prompt screen for 1 second and nothing happens.
Can someone help me please?
There is no inherent reason that a simple batch file would run in XP but not Windows 10. It is possible you are referencing a command or a 3rd party utility that no longer exists. To know more about what is actually happening, you will need to do one of the following:
Add a pause to the batch file so that you can see what is happening before it exits.
Right click on one of the .bat files and select "edit". This will open the file in notepad.
Go to the very end of the file and add a new line by pressing "enter".
type pause.
Save the file.
Run the file again using the same method you did before.
- OR -
Run the batch file from a static command prompt so the window does not close.
In the folder where the .bat files are located, hold down the "shift" key and right click in the white space.
Select "Open Command Window Here".
You will now see a new command prompt. Type in the name of the batch file and press enter.
Once you have done this, I recommend creating a new question with the output you see after using one of the methods above.

How can a program run at specific time? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
(Sorry,I do a little change in my answer)
I want to know can I write a program that runs at a specific time?Is there any way to run a program automatically? And another question:Can I write a program that runs whenever another program is executed?
Note that it does not matter what the OS is,and I want a way to be in program code,that is I write a line of code that do the operation,because I cannot prompt different users to change their OS options to do the operation.
On windows you have the task scheduler, which can execute a programm at a specific time, with a specific user etc.
On linux you got something similar. The cronjobs/crontabs. An introduction you can find here.
based on new question:
What is the sense of this? You can't trigger your own program if it's not running. So basically your program must run in the background 24/7 and wait for events.
Maybe you should take a look at this post.
In windows you are having the task scheduler and the AT command. You refer this
link.
you need to develop a Daemon/Service process whose job is only to execute your application at required intervals or at specific time.

How to run an app from cmd in one line [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I am trying to make a c program that will open my internet apps e.g. chrome, thunderbird etc.
When i am using the
system("")
function i have to do it all in one line cause everytime i reuse it, it resets my directory to where the c project is saved.
How is that possible?
Depend on what system & shell you're on, the syntax may be different
On Windows cmd just use && or &. For example
notepad && mspaint
calc & dir
&& will run the second command if the first completed successfully. & will run the command in the background on Linux/Unix, whereas it'll run the first then the second command in Windows

Resources