Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Jun 29th, 2004, 1:16 PM   #1
Scunner
Newbie
 
Join Date: Jun 2004
Posts: 2
Rep Power: 0 Scunner is on a distinguished road
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
Scunner is offline   Reply With Quote
Old Jun 29th, 2004, 2:36 PM   #2
big_k105
PFO Founder

 
big_k105's Avatar
 
Join Date: Mar 2004
Location: Fargo, ND
Posts: 1,649
Rep Power: 10 big_k105 is on a distinguished road
Send a message via AIM to big_k105 Send a message via MSN to big_k105 Send a message via Yahoo to big_k105
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.
big_k105 is offline   Reply With Quote
Old Jul 15th, 2004, 3:25 PM   #3
Infinite Recursion
Programming Guru
 
Infinite Recursion's Avatar
 
Join Date: Jul 2004
Location: United States
Posts: 3,467
Rep Power: 8 Infinite Recursion is on a distinguished road
Send a message via MSN to Infinite Recursion Send a message via Yahoo to Infinite Recursion
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."
Infinite Recursion is offline   Reply With Quote
Old Sep 15th, 2004, 12:49 AM   #4
erebus
Programmer
 
erebus's Avatar
 
Join Date: Aug 2004
Location: /dev/null
Posts: 65
Rep Power: 5 erebus is on a distinguished road
Send a message via AIM to erebus
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'>&quot;Political power grows out of the barrel of a gun&quot; - Mao Tse-Tung</span></span>
erebus is offline   Reply With Quote
Old Sep 15th, 2004, 8:53 AM   #5
Infinite Recursion
Programming Guru
 
Infinite Recursion's Avatar
 
Join Date: Jul 2004
Location: United States
Posts: 3,467
Rep Power: 8 Infinite Recursion is on a distinguished road
Send a message via MSN to Infinite Recursion Send a message via Yahoo to Infinite Recursion
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."
Infinite Recursion is offline   Reply With Quote
Old Sep 15th, 2004, 8:31 PM   #6
erebus
Programmer
 
erebus's Avatar
 
Join Date: Aug 2004
Location: /dev/null
Posts: 65
Rep Power: 5 erebus is on a distinguished road
Send a message via AIM to erebus
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'>&quot;Political power grows out of the barrel of a gun&quot; - Mao Tse-Tung</span></span>
erebus is offline   Reply With Quote
Old Sep 15th, 2004, 9:42 PM   #7
Infinite Recursion
Programming Guru
 
Infinite Recursion's Avatar
 
Join Date: Jul 2004
Location: United States
Posts: 3,467
Rep Power: 8 Infinite Recursion is on a distinguished road
Send a message via MSN to Infinite Recursion Send a message via Yahoo to Infinite Recursion
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."
Infinite Recursion is offline   Reply With Quote
Old Sep 16th, 2004, 11:25 PM   #8
erebus
Programmer
 
erebus's Avatar
 
Join Date: Aug 2004
Location: /dev/null
Posts: 65
Rep Power: 5 erebus is on a distinguished road
Send a message via AIM to erebus
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'>&quot;Political power grows out of the barrel of a gun&quot; - Mao Tse-Tung</span></span>
erebus is offline   Reply With Quote
Old Sep 17th, 2004, 8:58 AM   #9
Infinite Recursion
Programming Guru
 
Infinite Recursion's Avatar
 
Join Date: Jul 2004
Location: United States
Posts: 3,467
Rep Power: 8 Infinite Recursion is on a distinguished road
Send a message via MSN to Infinite Recursion Send a message via Yahoo to Infinite Recursion
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."
Infinite Recursion is offline   Reply With Quote
Old Sep 17th, 2004, 6:23 PM   #10
Berto
Programming Guru
 
Join Date: Aug 2004
Posts: 1,022
Rep Power: 6 Berto is on a distinguished road
Send a message via AIM to Berto Send a message via MSN to Berto
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
Berto is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 1:33 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC