How keep cmd window open?

K

krlund

On XP Pro I use a shortcut to execute the command:
C:\WINDOWS\system32\cmd.exe /c ipconfig /all

The behavior I want to change is that immediately after the command is
executed the window is closed, not giving me enough time to look at the
results. How can I keep the window open until I can close it manually?
thanks
krl
 
R

Ramesh [MVP]

Use: cmd.exe /k ipconfig /all

--
Ramesh, Microsoft MVP
Windows XP Shell/User
http://windowsxp.mvps.org
--------------------------------------------
Using ToolbarCop to remove the unwanted Toolband, Toolbar Icons and BHO:
http://windowsxp.mvps.org/toolbarcop.htm
--------------------------------------------
The Parasite Fight - Quick Fix Protocol:
http://aumha.org/a/quickfix.php
--------------------------------------------
On XP Pro I use a shortcut to execute the command:
C:\WINDOWS\system32\cmd.exe /c ipconfig /all

The behavior I want to change is that immediately after the command is
executed the window is closed, not giving me enough time to look at the
results. How can I keep the window open until I can close it manually?
thanks
krl
 
G

Guest

Click on START> RUN
type in CMD and press enter button

Command window opens and you can keep it open all year.....

Run what you need to and it will not shut down
 
S

Shenan Stanley

krlund said:
On XP Pro I use a shortcut to execute the command:
C:\WINDOWS\system32\cmd.exe /c ipconfig /all

The behavior I want to change is that immediately after the command is
executed the window is closed, not giving me enough time to look at
the results. How can I keep the window open until I can close it
manually? thanks

Instead of your command (in the shortcut), change it to:

C:\WINDOWS\system32\cmd.exe /k ipconfig /all

Note that if you open a command prompt and type: cmd /?, you get:

CMD [/A | /U] [/Q] [/D] [/E:ON | /E:OFF] [/F:ON | /F:OFF] [/V:ON | /V:OFF]
[[/S] [/C | /K] string]

/C Carries out the command specified by string and then terminates
/K Carries out the command specified by string but remains
/S Modifies the treatment of string after /C or /K (see below)
/Q Turns echo off
/D Disable execution of AutoRun commands from registry (see below)
/A Causes the output of internal commands to a pipe or file to be ANSI
/U Causes the output of internal commands to a pipe or file to be
Unicode
/T:fg Sets the foreground/background colors (see COLOR /? for more info)
/E:ON Enable command extensions (see below)
/E:OFF Disable command extensions (see below)
/F:ON Enable file and directory name completion characters (see below)
/F:OFF Disable file and directory name completion characters (see below)
/V:ON Enable delayed environment variable expansion using ! as the
delimiter. For example, /V:ON would allow !var! to expand the
variable var at execution time. The var syntax expands variables
at input time, which is quite a different thing when inside of a FOR
loop.

Where it is obvious what the /C you were using is to do and the /K I am
suggesting you use does.
 
W

Wesley Vogel

Why not make a batch file.
Name it ipconfig.bat
Include this...


ipconfig /all
pause


Pause will keep the window open until you
Press any key to continue . . .

Pause
[[Suspends processing of a batch program and displays a message prompting
the user to press any key to continue.]]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top