Page 1 of 1

Bat file shuts down to quickly without a pause

Posted: 27 Jan 2015 21:54
by julesverne
Has anyone ever created a batch script that will error out unless they put a pause in, or the old fashioned ping -n 20 127.0.0.1 1>nul ?

Cause that is what I'm experiencing. It is blowing my mind. Without the ping it closes. Is it possible my computer is too fast for the batch file? i7 win 64 bit 8 GB Ram

Re: Bat file shuts down to quickly without a pause

Posted: 27 Jan 2015 22:12
by Squashman
I wish I was omniscient. Then I wouldn't need to see your batch file to deduce what is wrong with it.

Re: Bat file shuts down to quickly without a pause

Posted: 27 Jan 2015 22:18
by julesverne
I understand the snarkiness squashman, and would write the same thing as you did. However, in this instance, I was just asking generally has anyone ever seen this? I googled it and couldn't find any evidence, but I know you all do a lot of bat script writing, and have seen mentioned on the forum a few times about sometimes the set command eating up memory. Didn't know if others have seen other oddities, such as something like this.

Re: Bat file shuts down to quickly without a pause

Posted: 27 Jan 2015 22:58
by Squashman
julesverne wrote:Cause that is what I'm experiencing. It is blowing my mind. Without the ping it closes. Is it possible my computer is too fast for the batch file? i7 win 64 bit 8 GB Ram

julesverne wrote:However, in this instance, I was just asking generally has anyone ever seen this?

So what you are saying is your first comment wasn't really a real world experience and it really wasn't blowing your mind. Because if it was then you would have code to show us and it would not be a generally SPEAKING kind of comment.

Re: Bat file shuts down to quickly without a pause

Posted: 27 Jan 2015 23:31
by julesverne
You're completely right @squashman I should've known better than to ask a question without including code. In the future I will refrain from doing so as they do invite sarcastic responses. And honestly I really appreciate this forum and I don't like seeing snarky comments as they are not helpful to anyone. But I will definitely take the blame for this one. My apologies everyone.

Re: Bat file shuts down to quickly without a pause

Posted: 28 Jan 2015 15:19
by ShadowThief
julesverne wrote:You're completely right @squashman I should've known better than to ask a question without including code. In the future I will refrain from doing so as they do invite sarcastic responses. And honestly I really appreciate this forum and I don't like seeing snarky comments as they are not helpful to anyone. But I will definitely take the blame for this one. My apologies everyone.

Oh, that's just Squashman being Squashman.

Re: Bat file shuts down to quickly without a pause

Posted: 29 Jan 2015 08:54
by foxidrive
julesverne wrote:Has anyone ever created a batch script that will error out unless they put a pause in


Are you asking if cmd will close the window if there is an error in the batch code? yes. It can and does.

In the MSDOS and Win9x days command.com had a debugging switch that would step through the lines of code - these days you have to use pause and figure out where the syntax error is that is causing this problem.

Re: Bat file shuts down to quickly without a pause

Posted: 02 Feb 2015 10:56
by Samir
foxidrive wrote:In the MSDOS and Win9x days command.com had a debugging switch that would step through the lines of code - these days you have to use pause and figure out where the syntax error is that is causing this problem.
I think you can still do this if you execute a new command interpreter running the batch file in modern versions of 'DOS'. I think I remember doing it several times for debugging in recent years and haven't been using real DOS or win9x.

Re: Bat file shuts down to quickly without a pause

Posted: 02 Feb 2015 16:09
by foxidrive
Samir wrote:
foxidrive wrote:In the MSDOS and Win9x days command.com had a debugging switch that would step through the lines of code - these days you have to use pause and figure out where the syntax error is that is causing this problem.
I think you can still do this if you execute a new command interpreter running the batch file in modern versions of 'DOS'.


Proof-of-concept code would be handy.

Re: Bat file shuts down to quickly without a pause

Posted: 03 Feb 2015 06:11
by Samir
foxidrive wrote:
Samir wrote:
foxidrive wrote:In the MSDOS and Win9x days command.com had a debugging switch that would step through the lines of code - these days you have to use pause and figure out where the syntax error is that is causing this problem.
I think you can still do this if you execute a new command interpreter running the batch file in modern versions of 'DOS'.


Proof-of-concept code would be handy.
Nope, not there on xp. I'll try it on my win9x boxes when I get back around them.