Bat file shuts down to quickly without a pause
Moderator: DosItHelp
-
- Posts: 81
- Joined: 19 Nov 2013 00:41
Bat file shuts down to quickly without a pause
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
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
I wish I was omniscient. Then I wouldn't need to see your batch file to deduce what is wrong with it.
-
- Posts: 81
- Joined: 19 Nov 2013 00:41
Re: Bat file shuts down to quickly without a pause
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
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.
-
- Posts: 81
- Joined: 19 Nov 2013 00:41
Re: Bat file shuts down to quickly without a pause
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.
-
- Expert
- Posts: 1167
- Joined: 06 Sep 2013 21:28
- Location: Virginia, United States
Re: Bat file shuts down to quickly without a pause
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
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
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.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.
Re: Bat file shuts down to quickly without a pause
Samir wrote:I think you can still do this if you execute a new command interpreter running the batch file in modern versions of 'DOS'.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.
Proof-of-concept code would be handy.
Re: Bat file shuts down to quickly without a pause
Nope, not there on xp. I'll try it on my win9x boxes when I get back around them.foxidrive wrote:Samir wrote:I think you can still do this if you execute a new command interpreter running the batch file in modern versions of 'DOS'.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.
Proof-of-concept code would be handy.