I want to write a batch file that will open all files in D:\software.
I have searched the internet but could not find anything. Can anyone help me?
I want to write a batch file that will open all files in D:\software.
I have searched the internet but could not find anything. Can anyone help me?
Here's a batch script that will navigate to D:\software
and execute all programs (*.exe):
executeAll.cmd
cd D:\software
for %%f in (*.exe) do (
echo %%~nf
start "" "%%f"
)
exit
If you want the script to open all files, change the first line to
for %%f in (*.*) do (
In order to run the batch file, you'll need to save it with the proper extension. In Notepad, this is trivial but not obvious: when you save the file, put quotes around the filename + extension, like "executeAll.cmd"
. Otherwise, it will be saved with a .txt extension like executeAll.cmd.txt
.