![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: Jun 2004
Posts: 2
Rep Power: 0
![]() |
What do you type in the code of a batch file so that it doesn't automatically close the dos prompt once it has completed the command?
I have setup a batch file that scans files in games as a sort of anti cheat patch. It compares differences between proper files and existing ones, I just want it to display or log the results instead of closing. If I cant stop it closing how could I make it copy the results into a textfile or log? Cheers Scunner |
|
|
|
|
|
#2 |
|
PFO Founder
![]() ![]() |
the only way i could think of doing this would be to either pause the program and have it wait for you to hit enter or for you to run the script while in the command promt instead of double clicking it. im not sure what you would use to make the promt not disappear besides doin this but maybe someone else will know
![]() you could have it return all the info it finds into a file by using the >> operator i believe i would give it a try and see what happens ![]()
__________________
BIG K aka Kyle Programming Forums Kyle K Online Please do not PM or email me programming questions. Post them in the forums instead. |
|
|
|
|
|
#3 |
|
Programming Guru
![]() ![]() ![]() |
running the batch file using CMD /K your.bat will have the DOS window remain open after the batch is complete
IR
__________________
http://jasonpowers.net "There are a thousand hacking at the branches of evil to one who is striking at the root." |
|
|
|
|
|
#4 |
|
Programmer
|
If you don't have cmd available to you(9x/ME) or want to make your batch code portable, use the pause command in the script. Something like:
echo Hello, FreeBSD! pause
__________________
<span style='font-size:14pt;line-height:100%'><span style='color:red'>"Political power grows out of the barrel of a gun" - Mao Tse-Tung</span></span> |
|
|
|
|
|
#5 |
|
Programming Guru
![]() ![]() ![]() |
wow.. this is 2 months old and comes back to life
![]() If you were to use a 'pause', you will not be able to continue executing, unless you un-pause. You could always redirect your scripts variables to a text file via pipes.
__________________
http://jasonpowers.net "There are a thousand hacking at the branches of evil to one who is striking at the root." |
|
|
|
|
|
#6 |
|
Programmer
|
Just an alternative one could use.. not really the best method around, as you've depicted. I haven't worked with batch in quite some time, but I do remember that cmd was not available in DOS 5.0 :-P.
__________________
<span style='font-size:14pt;line-height:100%'><span style='color:red'>"Political power grows out of the barrel of a gun" - Mao Tse-Tung</span></span> |
|
|
|
|
|
#7 |
|
Programming Guru
![]() ![]() ![]() |
i think cmd came along within a windows-subset or something... the normal console would have appeared via 'command'.
__________________
http://jasonpowers.net "There are a thousand hacking at the branches of evil to one who is striking at the root." |
|
|
|
|
|
#8 |
|
Programmer
|
Indeed, command.com was the interpreter then, though I do believe it is still accesible in NT-centric Windows OSs. I wouldn't recommend using it unless your school has restricted cmd.exe, but that's another story :-P. The cool thing about command.com is that you can integrate your own commands or command versions, as apposed to cmd having all of the utilities embedded into it.
__________________
<span style='font-size:14pt;line-height:100%'><span style='color:red'>"Political power grows out of the barrel of a gun" - Mao Tse-Tung</span></span> |
|
|
|
|
|
#9 |
|
Programming Guru
![]() ![]() ![]() |
Yup. What is also cool, at least during my years of high school... was the fact you could rename the windows help option in the start menu to command.com and get DOS shell access despite security programs
![]()
__________________
http://jasonpowers.net "There are a thousand hacking at the branches of evil to one who is striking at the root." |
|
|
|
|
|
#10 |
|
Programming Guru
![]() |
or hacking the registry with it lockout was fun.Had a lot of people coming up t me and saying ooo how you do that.
__________________
"Put your hand on a hot stove for a minute, and it seems like an hour. Sit with a pretty girl for an hour, and it seems like a minute. THAT'S relativity." - Albert Einstein |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|