Why do my .BAT files on Windows 7 not PAUSE properly?Windows 7, files reappear after deletionUnexpected media...

How do I handle a potential work/personal life conflict as the manager of one of my friends?

Intersection Puzzle

Avoiding direct proof while writing proof by induction

Are there any examples of a variable being normally distributed that is *not* due to the Central Limit Theorem?

Can a virus destroy the BIOS of a modern computer?

How do I gain back my faith in my PhD degree?

Assassin's bullet with mercury

Is it inappropriate for a student to attend their mentor's dissertation defense?

Can we compute the area of a quadrilateral with one right angle when we only know the lengths of any three sides?

If human space travel is limited by the G force vulnerability, is there a way to counter G forces?

Is it acceptable for a professor to tell male students to not think that they are smarter than female students?

What does “the session was packed” mean in this context?

How does a predictive coding aid in lossless compression?

How do I deal with an unproductive colleague in a small company?

How badly should I try to prevent a user from XSSing themselves?

What killed these X2 caps?

What is the most common color to indicate the input-field is disabled?

What about the virus in 12 Monkeys?

How to tell a function to use the default argument values?

How would I stat a creature to be immune to everything but the Magic Missile spell? (just for fun)

What's the in-universe reasoning behind sorcerers needing material components?

Personal Teleportation: From Rags to Riches

How seriously should I take size and weight limits of hand luggage?

Im going to France and my passport expires June 19th



Why do my .BAT files on Windows 7 not PAUSE properly?


Windows 7, files reappear after deletionUnexpected media key behavior on new Acer AspireLaptops overheats and shuts off when I play gamescannot delete windows executable filesDisable windows 7 auto-restart after end-tasking certain processesLogitech keyboard periodically “locks up”Batch file troubles in Windows 7CMD window will not close if folder is closed during execution of bat filebat file seemingly ignoring pause statementscmd prompt in windows 10 hangs after running bat routine













5















I've been playing around with writing batch files on my computer for some time, and I am confused about why PAUSE doesn't work like I thought(maybe I'm just doing it wrong idk, just really confused).



Basically I have:



@echo off
echo Hello!
pause
echo Hi again!
pause
echo HEY HEY!!
pause


and when it runs I get:



Hello!
Press any key to continue...


I then press just one key and this occurs:



Hi again!
Press any key to continue...
HEY HEY!!
Press any key to continue...


I don't understand why it skips the second PAUSE...I've noticed that if I was to do:



@echo off
echo Hello!
pause
echo Hi again!
pause
pause
echo HEY HEY!!
pause


then it will pause on "Hi again!" opposed to executing it without pause(however it will print "Press any key to continue..." two times consecutively)



I'm just really lost and can not proceed with my life until I know why it does this o:










share|improve this question
















bumped to the homepage by Community 4 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
















  • It works as expected for me (in Windows 7), you sure you don't have a keyboard problem? If you wrap the echo argument in quotes does it work differently? (ie: echo "Hi there!", echo "Hi Again", etc.)

    – Ƭᴇcʜιᴇ007
    Oct 31 '14 at 16:57













  • Let me try that now...and I have no keyboard problem, it will only skip that pause, and none other

    – Ryan Bollinger
    Oct 31 '14 at 17:09






  • 2





    You know, I feel really stupid, any key I hit other then the down arrow makes it work fine.....jeez I can't believe I've spent 2 hours trying to figure this out for nothing xD

    – Ryan Bollinger
    Oct 31 '14 at 17:11






  • 3





    Yup, hitting any arrow key does the same thing for me that you saw as well. Good catch. Get in the habit of using Enter. ;)

    – Ƭᴇcʜιᴇ007
    Oct 31 '14 at 17:15


















5















I've been playing around with writing batch files on my computer for some time, and I am confused about why PAUSE doesn't work like I thought(maybe I'm just doing it wrong idk, just really confused).



Basically I have:



@echo off
echo Hello!
pause
echo Hi again!
pause
echo HEY HEY!!
pause


and when it runs I get:



Hello!
Press any key to continue...


I then press just one key and this occurs:



Hi again!
Press any key to continue...
HEY HEY!!
Press any key to continue...


I don't understand why it skips the second PAUSE...I've noticed that if I was to do:



@echo off
echo Hello!
pause
echo Hi again!
pause
pause
echo HEY HEY!!
pause


then it will pause on "Hi again!" opposed to executing it without pause(however it will print "Press any key to continue..." two times consecutively)



I'm just really lost and can not proceed with my life until I know why it does this o:










share|improve this question
















bumped to the homepage by Community 4 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
















  • It works as expected for me (in Windows 7), you sure you don't have a keyboard problem? If you wrap the echo argument in quotes does it work differently? (ie: echo "Hi there!", echo "Hi Again", etc.)

    – Ƭᴇcʜιᴇ007
    Oct 31 '14 at 16:57













  • Let me try that now...and I have no keyboard problem, it will only skip that pause, and none other

    – Ryan Bollinger
    Oct 31 '14 at 17:09






  • 2





    You know, I feel really stupid, any key I hit other then the down arrow makes it work fine.....jeez I can't believe I've spent 2 hours trying to figure this out for nothing xD

    – Ryan Bollinger
    Oct 31 '14 at 17:11






  • 3





    Yup, hitting any arrow key does the same thing for me that you saw as well. Good catch. Get in the habit of using Enter. ;)

    – Ƭᴇcʜιᴇ007
    Oct 31 '14 at 17:15
















5












5








5








I've been playing around with writing batch files on my computer for some time, and I am confused about why PAUSE doesn't work like I thought(maybe I'm just doing it wrong idk, just really confused).



Basically I have:



@echo off
echo Hello!
pause
echo Hi again!
pause
echo HEY HEY!!
pause


and when it runs I get:



Hello!
Press any key to continue...


I then press just one key and this occurs:



Hi again!
Press any key to continue...
HEY HEY!!
Press any key to continue...


I don't understand why it skips the second PAUSE...I've noticed that if I was to do:



@echo off
echo Hello!
pause
echo Hi again!
pause
pause
echo HEY HEY!!
pause


then it will pause on "Hi again!" opposed to executing it without pause(however it will print "Press any key to continue..." two times consecutively)



I'm just really lost and can not proceed with my life until I know why it does this o:










share|improve this question
















I've been playing around with writing batch files on my computer for some time, and I am confused about why PAUSE doesn't work like I thought(maybe I'm just doing it wrong idk, just really confused).



Basically I have:



@echo off
echo Hello!
pause
echo Hi again!
pause
echo HEY HEY!!
pause


and when it runs I get:



Hello!
Press any key to continue...


I then press just one key and this occurs:



Hi again!
Press any key to continue...
HEY HEY!!
Press any key to continue...


I don't understand why it skips the second PAUSE...I've noticed that if I was to do:



@echo off
echo Hello!
pause
echo Hi again!
pause
pause
echo HEY HEY!!
pause


then it will pause on "Hi again!" opposed to executing it without pause(however it will print "Press any key to continue..." two times consecutively)



I'm just really lost and can not proceed with my life until I know why it does this o:







windows-7 batch-file






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 10 '14 at 12:12









Hennes

59.4k793144




59.4k793144










asked Oct 31 '14 at 16:45









Ryan BollingerRyan Bollinger

262




262





bumped to the homepage by Community 4 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.







bumped to the homepage by Community 4 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.















  • It works as expected for me (in Windows 7), you sure you don't have a keyboard problem? If you wrap the echo argument in quotes does it work differently? (ie: echo "Hi there!", echo "Hi Again", etc.)

    – Ƭᴇcʜιᴇ007
    Oct 31 '14 at 16:57













  • Let me try that now...and I have no keyboard problem, it will only skip that pause, and none other

    – Ryan Bollinger
    Oct 31 '14 at 17:09






  • 2





    You know, I feel really stupid, any key I hit other then the down arrow makes it work fine.....jeez I can't believe I've spent 2 hours trying to figure this out for nothing xD

    – Ryan Bollinger
    Oct 31 '14 at 17:11






  • 3





    Yup, hitting any arrow key does the same thing for me that you saw as well. Good catch. Get in the habit of using Enter. ;)

    – Ƭᴇcʜιᴇ007
    Oct 31 '14 at 17:15





















  • It works as expected for me (in Windows 7), you sure you don't have a keyboard problem? If you wrap the echo argument in quotes does it work differently? (ie: echo "Hi there!", echo "Hi Again", etc.)

    – Ƭᴇcʜιᴇ007
    Oct 31 '14 at 16:57













  • Let me try that now...and I have no keyboard problem, it will only skip that pause, and none other

    – Ryan Bollinger
    Oct 31 '14 at 17:09






  • 2





    You know, I feel really stupid, any key I hit other then the down arrow makes it work fine.....jeez I can't believe I've spent 2 hours trying to figure this out for nothing xD

    – Ryan Bollinger
    Oct 31 '14 at 17:11






  • 3





    Yup, hitting any arrow key does the same thing for me that you saw as well. Good catch. Get in the habit of using Enter. ;)

    – Ƭᴇcʜιᴇ007
    Oct 31 '14 at 17:15



















It works as expected for me (in Windows 7), you sure you don't have a keyboard problem? If you wrap the echo argument in quotes does it work differently? (ie: echo "Hi there!", echo "Hi Again", etc.)

– Ƭᴇcʜιᴇ007
Oct 31 '14 at 16:57







It works as expected for me (in Windows 7), you sure you don't have a keyboard problem? If you wrap the echo argument in quotes does it work differently? (ie: echo "Hi there!", echo "Hi Again", etc.)

– Ƭᴇcʜιᴇ007
Oct 31 '14 at 16:57















Let me try that now...and I have no keyboard problem, it will only skip that pause, and none other

– Ryan Bollinger
Oct 31 '14 at 17:09





Let me try that now...and I have no keyboard problem, it will only skip that pause, and none other

– Ryan Bollinger
Oct 31 '14 at 17:09




2




2





You know, I feel really stupid, any key I hit other then the down arrow makes it work fine.....jeez I can't believe I've spent 2 hours trying to figure this out for nothing xD

– Ryan Bollinger
Oct 31 '14 at 17:11





You know, I feel really stupid, any key I hit other then the down arrow makes it work fine.....jeez I can't believe I've spent 2 hours trying to figure this out for nothing xD

– Ryan Bollinger
Oct 31 '14 at 17:11




3




3





Yup, hitting any arrow key does the same thing for me that you saw as well. Good catch. Get in the habit of using Enter. ;)

– Ƭᴇcʜιᴇ007
Oct 31 '14 at 17:15







Yup, hitting any arrow key does the same thing for me that you saw as well. Good catch. Get in the habit of using Enter. ;)

– Ƭᴇcʜιᴇ007
Oct 31 '14 at 17:15












1 Answer
1






active

oldest

votes


















0














It's working as expected. The pause statement just waits for input. The only switch is to hide the fact it's waiting for a keypress.



When I run the last batch file you showed, I see this:



C:UsersasdfDesktop>more test.bat
@echo off
echo Hello!
pause
echo Hi again!
pause
pause
echo HEY HEY!!
pause

C:UsersasdfDesktop>test
Hello!
Press any key to continue . . .
Hi again!
Press any key to continue . . .
Press any key to continue . . .
HEY HEY!!
Press any key to continue . . .


So I'm finding it difficult to understand what you're asking for...






share|improve this answer


























  • That doesn't explain why the second statement is being skipped.

    – Jim G.
    Oct 31 '14 at 16:55






  • 1





    I shouldn't need 2 consecutive PAUSE statements after "Hi again!" I'm basically asking why 1 PAUSE isn't working.

    – Ryan Bollinger
    Oct 31 '14 at 17:03













  • That's how it runs on Windows 7...

    – Canadian Luke
    Oct 31 '14 at 17:08











  • @JimG. As you can see from the OP's comments above, it is the expected behaviour

    – Canadian Luke
    Oct 31 '14 at 17:29












Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "3"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f834375%2fwhy-do-my-bat-files-on-windows-7-not-pause-properly%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














It's working as expected. The pause statement just waits for input. The only switch is to hide the fact it's waiting for a keypress.



When I run the last batch file you showed, I see this:



C:UsersasdfDesktop>more test.bat
@echo off
echo Hello!
pause
echo Hi again!
pause
pause
echo HEY HEY!!
pause

C:UsersasdfDesktop>test
Hello!
Press any key to continue . . .
Hi again!
Press any key to continue . . .
Press any key to continue . . .
HEY HEY!!
Press any key to continue . . .


So I'm finding it difficult to understand what you're asking for...






share|improve this answer


























  • That doesn't explain why the second statement is being skipped.

    – Jim G.
    Oct 31 '14 at 16:55






  • 1





    I shouldn't need 2 consecutive PAUSE statements after "Hi again!" I'm basically asking why 1 PAUSE isn't working.

    – Ryan Bollinger
    Oct 31 '14 at 17:03













  • That's how it runs on Windows 7...

    – Canadian Luke
    Oct 31 '14 at 17:08











  • @JimG. As you can see from the OP's comments above, it is the expected behaviour

    – Canadian Luke
    Oct 31 '14 at 17:29
















0














It's working as expected. The pause statement just waits for input. The only switch is to hide the fact it's waiting for a keypress.



When I run the last batch file you showed, I see this:



C:UsersasdfDesktop>more test.bat
@echo off
echo Hello!
pause
echo Hi again!
pause
pause
echo HEY HEY!!
pause

C:UsersasdfDesktop>test
Hello!
Press any key to continue . . .
Hi again!
Press any key to continue . . .
Press any key to continue . . .
HEY HEY!!
Press any key to continue . . .


So I'm finding it difficult to understand what you're asking for...






share|improve this answer


























  • That doesn't explain why the second statement is being skipped.

    – Jim G.
    Oct 31 '14 at 16:55






  • 1





    I shouldn't need 2 consecutive PAUSE statements after "Hi again!" I'm basically asking why 1 PAUSE isn't working.

    – Ryan Bollinger
    Oct 31 '14 at 17:03













  • That's how it runs on Windows 7...

    – Canadian Luke
    Oct 31 '14 at 17:08











  • @JimG. As you can see from the OP's comments above, it is the expected behaviour

    – Canadian Luke
    Oct 31 '14 at 17:29














0












0








0







It's working as expected. The pause statement just waits for input. The only switch is to hide the fact it's waiting for a keypress.



When I run the last batch file you showed, I see this:



C:UsersasdfDesktop>more test.bat
@echo off
echo Hello!
pause
echo Hi again!
pause
pause
echo HEY HEY!!
pause

C:UsersasdfDesktop>test
Hello!
Press any key to continue . . .
Hi again!
Press any key to continue . . .
Press any key to continue . . .
HEY HEY!!
Press any key to continue . . .


So I'm finding it difficult to understand what you're asking for...






share|improve this answer















It's working as expected. The pause statement just waits for input. The only switch is to hide the fact it's waiting for a keypress.



When I run the last batch file you showed, I see this:



C:UsersasdfDesktop>more test.bat
@echo off
echo Hello!
pause
echo Hi again!
pause
pause
echo HEY HEY!!
pause

C:UsersasdfDesktop>test
Hello!
Press any key to continue . . .
Hi again!
Press any key to continue . . .
Press any key to continue . . .
HEY HEY!!
Press any key to continue . . .


So I'm finding it difficult to understand what you're asking for...







share|improve this answer














share|improve this answer



share|improve this answer








edited Oct 31 '14 at 17:07

























answered Oct 31 '14 at 16:49









Canadian LukeCanadian Luke

18.1k3091149




18.1k3091149













  • That doesn't explain why the second statement is being skipped.

    – Jim G.
    Oct 31 '14 at 16:55






  • 1





    I shouldn't need 2 consecutive PAUSE statements after "Hi again!" I'm basically asking why 1 PAUSE isn't working.

    – Ryan Bollinger
    Oct 31 '14 at 17:03













  • That's how it runs on Windows 7...

    – Canadian Luke
    Oct 31 '14 at 17:08











  • @JimG. As you can see from the OP's comments above, it is the expected behaviour

    – Canadian Luke
    Oct 31 '14 at 17:29



















  • That doesn't explain why the second statement is being skipped.

    – Jim G.
    Oct 31 '14 at 16:55






  • 1





    I shouldn't need 2 consecutive PAUSE statements after "Hi again!" I'm basically asking why 1 PAUSE isn't working.

    – Ryan Bollinger
    Oct 31 '14 at 17:03













  • That's how it runs on Windows 7...

    – Canadian Luke
    Oct 31 '14 at 17:08











  • @JimG. As you can see from the OP's comments above, it is the expected behaviour

    – Canadian Luke
    Oct 31 '14 at 17:29

















That doesn't explain why the second statement is being skipped.

– Jim G.
Oct 31 '14 at 16:55





That doesn't explain why the second statement is being skipped.

– Jim G.
Oct 31 '14 at 16:55




1




1





I shouldn't need 2 consecutive PAUSE statements after "Hi again!" I'm basically asking why 1 PAUSE isn't working.

– Ryan Bollinger
Oct 31 '14 at 17:03







I shouldn't need 2 consecutive PAUSE statements after "Hi again!" I'm basically asking why 1 PAUSE isn't working.

– Ryan Bollinger
Oct 31 '14 at 17:03















That's how it runs on Windows 7...

– Canadian Luke
Oct 31 '14 at 17:08





That's how it runs on Windows 7...

– Canadian Luke
Oct 31 '14 at 17:08













@JimG. As you can see from the OP's comments above, it is the expected behaviour

– Canadian Luke
Oct 31 '14 at 17:29





@JimG. As you can see from the OP's comments above, it is the expected behaviour

– Canadian Luke
Oct 31 '14 at 17:29


















draft saved

draft discarded




















































Thanks for contributing an answer to Super User!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f834375%2fwhy-do-my-bat-files-on-windows-7-not-pause-properly%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

VNC viewer RFB protocol error: bad desktop size 0x0I Cannot Type the Key 'd' (lowercase) in VNC Viewer...

Tribunal Administrativo e Fiscal de Mirandela Referências Menu de...

looking for continuous Screen Capture for retroactivly reproducing errors, timeback machineRolling desktop...