Windows 7 Forums Search
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows 7. The Windows 7 forum also covers news and updates and has an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7 - Command Prompt

 
05-20-2011   #1


Windows 7 Home Premium 64bit
 
 

Command Prompt

Ok so every time I try to open the command prompt using an external source (batch file, small c++ program i made to say Hi to me through the command prompt) it instantly closes. Does anyone have any idea why this is happening and if so how can I fix it?

Thanks,
Wave

My System SpecsSystem Spec
05-20-2011   #2
ryo


 
 


hi and welcome,
maybe your script error?
and for what you have to make like that???
My System SpecsSystem Spec
05-20-2011   #3


Microsoft Windows 7 Home Premium 64-bit 7601 Multiprocessor Free Service Pack 1
 
 


You can also make the cmd widow stay open with the /k switch

Command Prompt-capture.jpg
My System SpecsSystem Spec
.


05-20-2011   #4


XP / Win7 x64 Pro
 
 


That sounds about right. If you launch cmd from a script it won't stay open unless you have a pause built-in or it's waiting for input. The fix is in your programming.
My System SpecsSystem Spec
05-20-2011   #5
TCG


 
 


Quote   Quote: Originally Posted by FliGi7 View Post
That sounds about right. If you launch cmd from a script it won't stay open unless you have a pause built-in or it's waiting for input. The fix is in your programming.
Indeed. This is normal behavior.

An alternative would be to run the batch file from an already open command prompt window if you'd like to see the output without changing the script in any way. Easiest solution would be to add a pause on the last line of your batch file.
My System SpecsSystem Spec
05-20-2011   #6


W 7 64-bit Ultimate
 
 


Hello wave407, welcome to Seven Forums!



I use the method outlined in this tutorial at the link below to add a shortcut to the desktop that opens an elevated command window with one click.


Elevated Program Shortcut without UAC Prompt - Create
click to enlarge
Command Prompt-task_cmd.jpg

My System SpecsSystem Spec
05-20-2011   #7


Windows 7 Home Premium 64bit
 
 


See that is why i am confused...I do have a pause built in to my hello message and the batch file I'm trying to use I didn't make but I tried it on my other computer and it opens up and stays open
My System SpecsSystem Spec
05-20-2011   #8
TCG


 
 


Try running the batch file from an already opened command prompt, this should at least spit out the output so you can see it, and hopefully an error of some sort telling you what is wrong.
My System SpecsSystem Spec
05-20-2011   #9


Windows 7 Home Premium 64bit
 
 


ok i figured it out...Thanks guys I really appreciate it
My System SpecsSystem Spec
05-20-2011   #10


Microsoft Windows 7 Home Premium 64-bit 7601 Multiprocessor Free Service Pack 1
 
 


You are welcome. Would you care to share the solution with us to help others?
My System SpecsSystem Spec
Reply

 Command Prompt problems?



Thread Tools



Similar Threads for: Command Prompt
Thread Forum
Run administrative command prompt from command prompt General Discussion
Command Prompt Tutorials
command prompt bug ? General Discussion
Command Prompt command <ipconfig> not working Network & Sharing
How to fix MBR through command prompt? General Discussion


All times are GMT -5. The time now is 12:02 AM.



Windows 7 Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows 7" and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd
  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30