I use WinXP sp3, and I have created a .bat file that does something. When I double click on it, a Notepad is opened and I can edit the batch file - but it is not run ??!?!
I expect that when I double click a .bat file - it should run, no? How can I fix this?
If you want the command prompt cmd widnow to stay open after executing the last command in batch file –you should write cmd /k command at the end of your batch file. This command will prevent the command prompt window from closing and you'll get the prompt back for giving more commands in the cmd window.
Open Notepad ("Start" menu > "Run" > type notepad > press Enter). Click on "File" > "Save As...", and name the file with a batch file extension (ie: "startmyprg. bat").
Run batch files on startup Open File Explorer. Open the folder containing the batch file. Right-click the batch file and select the Copy option. Use the Windows key + R keyboard shortcut to open the Run command.
Check if you have this key in your registry :
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.bat\UserChoice
if you have one it means that the .bat extension is currently associated with notepad (or another program defined by the "Progid" key under this node).
Backup you registry and remove this .bat "UserChoice" node.
your .bat files should then run normally.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With