batch file not allowing new command

January 11, 2011 at 14:51:47
Specs: Windows XP pro, 797mhz/376 mb
so yeah this is literally my first day using batch files so i'm new to most of the commands and just trying things out. i created a batch to run read-only checkdisk (chkdsk/v) and want it to allow me to enter a new command. i know if i type -
chkdsk/v
pause

that will keep the window open but closes when i hit any key. any ideas how to set it to let me enter a new command after program runs?

(p.s. no keep window open option on desktop icon properties)


See More: batch file not allowing new command

Report •


#1
January 11, 2011 at 15:11:57
Start -> Run -> Type CMD to open the terminal. Type as many command as you want.

This should help you too...

http://www.robvanderwoude.com/batch...


Report •

#2
January 11, 2011 at 20:37:26
thanks but using cmd isn't the issue i'm trying to keep the cmd window open after a batch program is run for when i start with more complex batch files for whatever i may need... basically run batch and window stays open after allowing more commands

Report •

#3
January 12, 2011 at 00:01:11
I dont know what you mean with "stays open after allowing more commands"
Just put your commands after the 'pause'? Batch will execute the commands each for each.

::SCRIPT.bat

@echo off
echo.
echo Command: ipconfig
echo.
ipconfig
echo.
echo Hit your keyboard to continue . . .
echo.
pause>nul
echo You hitted your keyboard..
echo.
echo Command: dir /b *.txt
echo.
dir /b *.txt
echo.
echo Hit your keyboard again to exit.
echo.
pause>nul
exit

Happy is ONE who says I am an OttoMAN.


Report •

Related Solutions

#4
January 12, 2011 at 00:30:48
Since you're just starting out, get used to running BATs at the prompt and save yourself a bunch of grief.


=====================================
Life is too important to be taken seriously.

M2


Report •

#5
January 12, 2011 at 10:18:26
oohh ok so write everything into the script. ok thank you solves my problem

Report •


Ask Question