couple basic dos questions

NleahciM

Senior member
Aug 20, 2003
242
0
0
Hey - so I need to do some things in "dos" on a computer running windows xp pro sp2. So mostly right now I have two problems:

1. how do I change to a directory with a space in it's name? I'm trying to switch to c:/program files. Can't figure out how...

2. How do I make a shortcut for something to run in dos? So that when it finishes running, the command window will stay up so that I can read the output?

Thanks for your help!
 

KLin

Lifer
Feb 29, 2000
30,433
748
126
1. either cd progra~1 or cd "program files"

2. Can you elaborate a little on what you mean?
 

NleahciM

Senior member
Aug 20, 2003
242
0
0
Originally posted by: KLin
1. either cd progra~1 or cd "program files"

2. Can you elaborate a little on what you mean?

A ha! I had tried program~1 - but I couldn't remember how many letters dos names were shortened to. I had also already tried the one with the quotation marks but it didn't work :( but pgora~1 did!

What I mean about the shortcut is that some programs when you run them in dos will quickly say write something and then finish, bringing you back to the dos prompt. But if you just make a shortcut to a program like this, it will run in dos, then the entire dos window will close, thus you can't see any output from the program after it has finished. To get around this I simply open up a dos prompt and find the correct program and run it from dos that way - but that's just kind of a pain...
 

kamper

Diamond Member
Mar 18, 2003
5,513
0
0
The typical solution is to add a read statement at the end of your program so that it will not exit until the user hits enter.
 

EagleKeeper

Discussion Club Moderator<br>Elite Member
Staff member
Oct 30, 2000
42,589
5
0
Set up a batch file to run the program.
Put an input statement after the execution statement.

You may also be able to set the properties of the shortcut to not close on exit.
 

MrChad

Lifer
Aug 22, 2001
13,507
3
81
Just wanted to point out that it's not DOS, it's the Command Line Interface (CLI). While Windows 9x included DOS, Windows NT/2000/XP do not.
 

Modeps

Lifer
Oct 24, 2000
17,254
44
91
Originally posted by: MrChad
Just wanted to point out that it's not DOS, it's the Command Line Interface (CLI). While Windows 9x included DOS, Windows NT/2000/XP do not.

:thumbsup:
 

NleahciM

Senior member
Aug 20, 2003
242
0
0
Originally posted by: MrChad
Just wanted to point out that it's not DOS, it's the Command Line Interface (CLI). While Windows 9x included DOS, Windows NT/2000/XP do not.

Hence why I quoted "dos" in my original post :)
 

SonicIce

Diamond Member
Apr 12, 2004
4,771
0
76
Hey, I have a question too! When I run a program from a BAT file, the program opens but the prompt stays open and I have to alt-tab and close it then go back to the program. Is there a command to add to tell it to close itself when its done launching the program? I have win98 if thats any help.