Embark on a journey of knowledge! Take the quiz and earn valuable credits.
Take A QuizChallenge yourself and boost your learning! Start the quiz now to earn credits.
Take A QuizUnlock your potential! Begin the quiz, answer questions, and accumulate credits along the way.
Take A QuizPlease log in to access this content. You will be redirected to the login page shortly.
LoginMicrosoft Microsoft DOS in Microsoft 3 years ago
Hello All,
There is an example of what I am try to ACHIEVE
I Created a test1.bat file. Inside that batch file added
-----------
echo off
cls
START C:\test2.bat
-----------
Now I created test2.bat and added it to test1.bat
-----------
echo off
cls
echo.test 2 here..
pause
-----------
When I execute I see the test2.bat open due to the pause command. What I was try to achieve is the test2.bat should close on its own even though you have a pause command.
When you complete the action I see the command prompt still running. I need to close it once the execution is done.
Hope if any one could help me.
Thanks & Regards
Girish Katti
The pause command will wait for a key to be pressed to continue. I do not know the technical reasons, but it will cause the command window not to terminate or continue on until a key has been pressed.
If the window remains open even after the script has completed, try adding CMD /c between start and test.bat .Hi,
Adding CMD /C closes the window after the second batch file is executed. Is there any way we can close the batch file having a pause entry.
I to agree its virtually not possible to do but any work around.
If you want it to stay open, replace cmd /c with cmd /k.Hi,
What I exactly need was to close the batch file having a pause statement.
Presently we are calling the second batch file from the first batch file and while we execute the first the second still remains open due to the pause statement.
I need the second batch file to close when we execute the first one.
Thanks in advance.
Quote from: girishkatti123 on June 21, 2009, 10:22:26 PM
I need the second batch file to close when we execute the first one.That just won't work. Pause waits for a key to be pressed. If you want to wait for a specific time, try this. Replace xx with desired time in seconds.
Thanks in advance.
Posted on 21 May 2022, this text provides information on Microsoft related to Microsoft DOS in Microsoft. Please note that while accuracy is prioritized, the data presented might not be entirely correct or up-to-date. This information is offered for general knowledge and informational purposes only, and should not be considered as a substitute for professional advice.
Turn Your Knowledge into Earnings.
No matter what stage you're at in your education or career, TuteeHub will help you reach the next level that you're aiming for. Simply,Choose a subject/topic and get started in self-paced practice sessions to improve your knowledge and scores.
Ready to take your education and career to the next level? Register today and join our growing community of learners and professionals.