Jump to content


- - - - -

How Can I Keep DOS Window Open After Program Runs


11 replies to this topic

#1 war59312

    GOD Bless America!

  • Members
  • PipPipPipPip
  • 1109 posts
  • Gender:Male
  • Location:U.S.A
  • Interests:Girls, Computers, Internet, Soccer

Posted 29 May 2003 - 10:09 PM

Hey,

Many one problem i really hate in winxp is that when i run a dos program it runs but when its complete it just closes. I want the window to remain open. How can i do this?

Thanks
Will

#2 Kal-El

    B.P.P.

  • Retired Crew
  • PipPipPipPipPip
  • 4918 posts
  • Gender:Male
  • Location:San Antonio, TX

Posted 29 May 2003 - 10:15 PM

Start -> Run -> Cmd.

You go into DOS windowed mode. Type the command you wish to execute making sure that you are in the correct directory. The command will run and you will still be in the DOS window.

#3 Illrigger

    War Hulk

  • Global Mods
  • 6953 posts
  • Gender:Male
  • Location:Iowa, USA
  • Interests:Computers, Networks, Pen-and-Paper RPGs, Home Theater, Movies, Music

Posted 29 May 2003 - 10:21 PM

Big POPPA Pump, on May 29 2003, 13:15, said:

Start -> Run -> Cmd.

You go into DOS windowed mode. Type the command you wish to execute making sure that you are in the correct directory. The command will run and you will still be in the DOS window.
Woohoo! Problem solved in one post - unusual as of late :)

#4 Kal-El

    B.P.P.

  • Retired Crew
  • PipPipPipPipPip
  • 4918 posts
  • Gender:Male
  • Location:San Antonio, TX

Posted 29 May 2003 - 10:23 PM

LOL! :lol:

#5 Phonics Monkey

    Custom member title

  • Moderators
  • 3192 posts
  • Gender:Male
  • Location:Florida, USA

Posted 30 May 2003 - 12:39 AM

Why not type the whole thing at once i.e.

Start->Run-> ipconfig /all will close on you
-and-
Start->Run-> cmd ipconfig /all will open the command prompt & ignore the ipconfig /all part completely
-however- Add the /k switch and...
Start->Run-> cmd /k ipconfig /all will open the command prompt, run ipconfig /all, and stay open for reading the output or another command.

Edited by Phonics Monkey, 30 May 2003 - 12:42 AM.


#6 Taco Bell

    Life is drama ...

  • Retired Crew
  • PipPipPipPipPip
  • 15588 posts
  • Gender:Male
  • Location:Detroit, Michigan USA
  • Interests:Everything, but sports and politics.

Posted 30 May 2003 - 01:28 AM

Good tips Phonics Monkey. As usual of course.

#7 war59312

    GOD Bless America!

  • Members
  • PipPipPipPip
  • 1109 posts
  • Gender:Male
  • Location:U.S.A
  • Interests:Girls, Computers, Internet, Soccer

Posted 30 May 2003 - 01:32 AM

Yes I know all that. I just want it to do it automatically like it does in Win98. You know so you can double click a dos file without having to go out of your way. Most I want this because I am compleing programs and its a pain in the ass if they just close and then I have to open them manually. Yea just does programs at the momeny. ;)

Thanks,
Will

#8 Phonics Monkey

    Custom member title

  • Moderators
  • 3192 posts
  • Gender:Male
  • Location:Florida, USA

Posted 30 May 2003 - 02:07 AM

Ah! That does make it a bit trickier. Only thing I can think of for that is (what I use), Assign a hot key to the command prompt in the properties for the cmd start menu shortcut (I use Ctrl+Alt+C).

and add command prompt here to the folders context menu:

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Folder\shell\CmdHere]
@="Command Prompt Here"

[HKEY_CLASSES_ROOT\Folder\shell\CmdHere\command]
@="c:\\Windows\\System32\\cmd.exe /f:on /t:0a /k cd \"%l\""


#9 Taco Bell

    Life is drama ...

  • Retired Crew
  • PipPipPipPipPip
  • 15588 posts
  • Gender:Male
  • Location:Detroit, Michigan USA
  • Interests:Everything, but sports and politics.

Posted 30 May 2003 - 02:27 AM

No, screw that, just make a batch file and have it loop on itself so it repeatedly re-runs the "ipconfig /all | more" command follow by a "pause".

Then, to make it easier to access, just make a shortcut to the batch file. If desired, you could even add a shortcut key to the shortcut (i.e. <Alt>+<Ctrl>+p), add it to QuickLaunch, pin it to the Start Menu, etc. to allow for bringing it up even quicker.

If your heart desires, I'm sure you can even find a GUI program out there which will give you the necessary information.

Edited by Taco Bell, 30 May 2003 - 02:30 AM.


#10 war59312

    GOD Bless America!

  • Members
  • PipPipPipPip
  • 1109 posts
  • Gender:Male
  • Location:U.S.A
  • Interests:Girls, Computers, Internet, Soccer

Posted 30 May 2003 - 05:11 AM

Um still a pain in the ass. Especially, for my class, I am in. :(

I think it is pretty stupid of Microsoft to take this "feature" away.

#11 bdb4269

    n00b

  • Rookies
  • Pip
  • 1 posts

Posted 06 September 2007 - 03:08 AM

QUOTE (Phonics Monkey @ May 29 2003, 20:07) <{POST_SNAPBACK}>
Ah! That does make it a bit trickier. Only thing I can think of for that is (what I use), Assign a hot key to the command prompt in the properties for the cmd start menu shortcut (I use Ctrl+Alt+C).

and add command prompt here to the folders context menu:

CODE
Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Folder\shell\CmdHere]
@="Command Prompt Here"

[HKEY_CLASSES_ROOT\Folder\shell\CmdHere\command]
@="c:\\Windows\\System32\\cmd.exe /f:on /t:0a /k cd \"%l\""


I know, and I am sorry, I am resurrecting this long dead thread - but I have a question about something.

In the above example "%l" pass's the full file name with path. Doing some experimenting of my own -- I have found that %1 (#1 instead of letter L) does the same thing. %2 %3, etc. seem to pass nothing. -- And of all the other letters I have tried each passed as itself without the "%" -- except "s" which passed a "1"

I can find nowhere after looking for an hour, that will tell me what different % variables can be used here and what get passed for each one.

Does anyone know where i can find such a chart -- or even just happen to know what the %s is, and/or any other % variables I can use here to pass different stuff?

Thanks in advance for any help!

#12 Chugworth

    Chugworth

  • Global Mods
  • 7379 posts
  • Gender:Male
  • Location:USA
  • Interests:Technology

Posted 06 September 2007 - 05:02 AM

QUOTE (bdb4269 @ Sep 5 2007, 22:08) <{POST_SNAPBACK}>
I know, and I am sorry, I am resurrecting this long dead thread - but I have a question about something.

In the above example "%l" pass's the full file name with path. Doing some experimenting of my own -- I have found that %1 (#1 instead of letter L) does the same thing. %2 %3, etc. seem to pass nothing. -- And of all the other letters I have tried each passed as itself without the "%" -- except "s" which passed a "1"

I can find nowhere after looking for an hour, that will tell me what different % variables can be used here and what get passed for each one.

Does anyone know where i can find such a chart -- or even just happen to know what the %s is, and/or any other % variables I can use here to pass different stuff?

Thanks in advance for any help!

I never realized that "%l" would work. They probably made it like that because sometimes the "l" looks like a "1". I don't think other letters do anything. %1 comes from switches given to DOS batch files. You could get other switches separated by spaces by using %2, %3, %4, etc. You could also use environment variables.

Here are some Windows environment variables: http://www.windowsitpro.com/Articles/Artic...23873.html?Ad=1

Now, try this batch file:

CODE
@echo off
echo Here are the first three switches you gave me: %1 %2 %3
echo Your Windows directory is: %windir%
echo The current time is: %time%
echo Your profile path is: %homepath%
echo A random number is: %random%


You could just call it "go.bat" or something. Now from a command window, type: "go one two three four" (without quotes). It will return something like this:

QUOTE
C:\Users\Chugworth>go one two three four
Here are the first three switches you gave me: one two three
Your Windows directory is: C:\Windows
The current time is: 23:56:23.45
Your profile path is: \Users\Chugworth
A random number is: 31329

Notice that the fourth switch, "four" is not shown, because we did not use "%4".





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users