Computer Hope
Microsoft => Microsoft DOS => Topic started by: Teroro on October 28, 2021, 02:43:23 PM
-
How do I run multiple cmd commands in a batch file?
I tried this and it works
cmd /k "cd C:\Users\TE IUBESC!!!MAMI\OneDrive\Desktop\Sheesh"
But after that the program stops doing anything.
How can I add more commands after that?
Like run this command right after the previous command then close the window?
-
There is no need to use CMD /K
cd /D "C:\Users\TE IUBESC!!!MAMI\OneDrive\Desktop\Sheesh"
echo I am in this folder: %cd%
echo Let's start notepad
start "" "notepad.exe"
-
This may help.
https://ss64.com/nt/cmd.html (https://ss64.com/nt/cmd.html)
/K Run Command and then return to the CMD prompt.
This is useful for testing, to examine variables
;D