Can´t run .bat file under windows 10 [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.
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.

Related

how to make command prompt run discord bot on startup [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 2 years ago.
Improve this question
I have made my own discrd bot using discord,js and want it to run whenever my computer starts.
i want it to open and perform the following-
cd C:\Users\manan\OneDrive\Desktop\project\
node .
Hello you can use the windows startup folder.
Click windows key + R.
Type shell:startup and click enter.
Create a new bat file in this folder.
Add your commands:
cd C:\Users\manan\OneDrive\Desktop\project\
node .
Or the scheduled tasks.
Click windows key + R.
Type taskschd.msc and click enter.
Go to Actions Panel -> create a basic task.
Set a name and click next.
Select at startup and click next again.
Select the bat file you want to run.
You’re 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

How to bind a key in batch? [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.
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.

Register and unregister XLL while Excel is open using bat or vbScript [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
I am just wondering if there is a good way I can write a short .bat script or .vbscript to do the following:
While Excel is open, unregister the xll.
Grab the xll from a folder I specify to the deployment folder, replacing the current XLL
Register the new xll as an Excel addin.
The reason I would like to have such a script is because every time I compile the code I get a new xll and it would be a huge hassle if I have manually save all the opening Excel workbooks, shut down Excel, and reopen Excel after replacing the file.
My current set up is Excel 2010 on Windows XP/7 depending on the machine I work on.
Thanks!
You can rename memory mapped files, like DLLs, but not delete them while open.
You can do what you want, but it won't take effect till you restart Excel, gaining you nothing.
Registration is only used to create objects. Once created they don't use the registry so unregistring will probably work. You have to rename existing DLL before copying a new one in. Registering easy (as long as you don't then try to create an object).

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