Solved Command Prompt

wave407

New member
Local time
6:22 PM
Messages
4
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 Computer

OS
Windows 7 Home Premium 64bit
hi and welcome,
maybe your script error?
and for what you have to make like that???
 

My Computer

Computer Manufacturer/Model Number
built up
OS
windows 7
CPU
Phenom II AMD Dragon 3.5Ghz
Memory
DDR3 4GB
Graphics Card(s)
ATI Radeon 512Mb
Monitor(s) Displays
HP L1506
Screen Resolution
1152 x 864
Hard Drives
WDC 1 TB SATA-II Green Power
Keyboard
HP wireless keyboard
Mouse
HP Optic
Internet Speed
1GB
You can also make the cmd widow stay open with the /k switch

Capture.JPG
 

My Computer

Computer type
Laptop
Computer Manufacturer/Model Number
Hewlett-Packard/G62-107SA Notebook
OS
Microsoft Windows 7 Home Premium 64-bit Service Pack 1
CPU
Intel(R) Core(TM) i3 CPU M 330 @ 2.13GHz
Motherboard
Hewlett-Packard 1425
Memory
8 GB DDR3
Graphics Card(s)
Intel(R) HD Graphics
Sound Card
Realtek High Definition Audio
Monitor(s) Displays
Builtin
Screen Resolution
1366 x 768 x 32 bits (4294967296 colors) @ 60 Hz
Hard Drives
250 GB SATA Hard Disk Drive 7200 rpm
2TB Seagate GoFlex USB 2 Drive
1TB Iomega Prestige USB 2 Drive
1.5TB Iomega Prestige USB 2 Drive (Samsung)
2TB WD MyBook Live NAS.
Mouse
Logitech Anywhere MX
Internet Speed
152 Mbs download 10 Mbs upload
Antivirus
Norton 360
Browser
Chrome
  • Like
Reactions: TCG
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 Computer

OS
XP / Win7 x64 Pro
CPU
Intel Quad-Core Q9450 @ 3.2GHz
Motherboard
Asus P5-E
Memory
2x2GB GSkill DDR2
Graphics Card(s)
NVIDIA GeForce 8600 GTS (EVGA)
Monitor(s) Displays
Dell 2408WFP
Screen Resolution
1920x1200
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 Computer

OS
.
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
task_cmd.jpg

 

My Computer

Computer Manufacturer/Model Number
* BFK Customs *
OS
W 7 64-bit Ultimate
CPU
Intel Q9550 Yorkfield
Motherboard
ASUS P5Q Pro
Memory
8GB Dominator 8500C5D
Graphics Card(s)
ATI : XFX 5870
Sound Card
Realtek HD Audio 7-1
Monitor(s) Displays
1x 47" LCD HDMI & 3x 26" LCD HDMI
Screen Resolution
1920x1080P & 1920x1200
Hard Drives
1x 80GB Intel X25-M G2 SSD : 1x 500GB & 1x 640GB WD Caviar Black(s)
PSU
Corsair 620HX
Case
Cooler Master RC-690
Cooling
Tuniq Tower 120, 2x 140mm and 3x 120mm case fans
Keyboard
Microsoft 500
Mouse
Razer Diamondback 3G
Internet Speed
14 Mb/s
Other Info
1x Koutech 3Gb/s SATA HDD Hot Swap Rack
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 Computer

OS
Windows 7 Home Premium 64bit
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 Computer

OS
.
ok i figured it out...Thanks guys I really appreciate it
 

My Computer

OS
Windows 7 Home Premium 64bit
You are welcome. Would you care to share the solution with us to help others?
 

My Computer

Computer type
Laptop
Computer Manufacturer/Model Number
Hewlett-Packard/G62-107SA Notebook
OS
Microsoft Windows 7 Home Premium 64-bit Service Pack 1
CPU
Intel(R) Core(TM) i3 CPU M 330 @ 2.13GHz
Motherboard
Hewlett-Packard 1425
Memory
8 GB DDR3
Graphics Card(s)
Intel(R) HD Graphics
Sound Card
Realtek High Definition Audio
Monitor(s) Displays
Builtin
Screen Resolution
1366 x 768 x 32 bits (4294967296 colors) @ 60 Hz
Hard Drives
250 GB SATA Hard Disk Drive 7200 rpm
2TB Seagate GoFlex USB 2 Drive
1TB Iomega Prestige USB 2 Drive
1.5TB Iomega Prestige USB 2 Drive (Samsung)
2TB WD MyBook Live NAS.
Mouse
Logitech Anywhere MX
Internet Speed
152 Mbs download 10 Mbs upload
Antivirus
Norton 360
Browser
Chrome
You are welcome. Would you care to share the solution with us to help others?

honestly? im not sure this will help anyone :)...but i got really mad and hit the keyboard in rage and it just started working...lol? maybe my computer just hates me?

joking..but i just opened the command prompt and drug the batch file onto the prompt...it still does the close thing when i try to directly open the batch file but now that i got it working i really dont care :)
 

My Computer

OS
Windows 7 Home Premium 64bit
Thanks. :roflmao:
 

My Computer

Computer type
Laptop
Computer Manufacturer/Model Number
Hewlett-Packard/G62-107SA Notebook
OS
Microsoft Windows 7 Home Premium 64-bit Service Pack 1
CPU
Intel(R) Core(TM) i3 CPU M 330 @ 2.13GHz
Motherboard
Hewlett-Packard 1425
Memory
8 GB DDR3
Graphics Card(s)
Intel(R) HD Graphics
Sound Card
Realtek High Definition Audio
Monitor(s) Displays
Builtin
Screen Resolution
1366 x 768 x 32 bits (4294967296 colors) @ 60 Hz
Hard Drives
250 GB SATA Hard Disk Drive 7200 rpm
2TB Seagate GoFlex USB 2 Drive
1TB Iomega Prestige USB 2 Drive
1.5TB Iomega Prestige USB 2 Drive (Samsung)
2TB WD MyBook Live NAS.
Mouse
Logitech Anywhere MX
Internet Speed
152 Mbs download 10 Mbs upload
Antivirus
Norton 360
Browser
Chrome
Back
Top