Command Prompt initialization

  • Thread starter Thread starter dkomo
  • Start date Start date
D

dkomo

I use DOS commands inside the Command Prompt window quite a lot.
Under older versions of Windows I used to be able to execute a BAT
file auotmatically when I opened a DOS window. The BAT file would set
the path, load some TSR's, cd to a particular directory, etc. It was
easy to specify the BAT file to execute in the DOS Window properties
box.

Under Windows XP there seems to be no way to do this. Does anyone
here know how or can you point me to some documentation that covers
it? None of the 3rd party books about Windows XP that I've looked at
mention it at all.


(e-mail address removed)
 
In
dkomo said:
I use DOS commands inside the Command Prompt window quite a lot.
Under older versions of Windows I used to be able to execute a BAT
file auotmatically when I opened a DOS window. The BAT file would set
the path, load some TSR's, cd to a particular directory, etc. It was
easy to specify the BAT file to execute in the DOS Window properties
box.

Under Windows XP there seems to be no way to do this. Does anyone
here know how or can you point me to some documentation that covers
it? None of the 3rd party books about Windows XP that I've looked at
mention it at all.


Why not create such a batch file and make a shortcut to it on the
desktop? Call it something like DOSWindow.bat. Anytime you want
to open a command prompt window, just click on that batch file
instead of whatever you're doing now.
 
Ken said:
In

Why not create such a batch file and make a shortcut to it on the
desktop? Call it something like DOSWindow.bat. Anytime you want
to open a command prompt window, just click on that batch file
instead of whatever you're doing now.

Do you mean that anytime I execute a DOS batch file from the Windows
XP desktop, it will automatically open a command prompt window?


(e-mail address removed)
 
dkomo said:
Do you mean that anytime I execute a DOS batch file from the Windows
XP desktop, it will automatically open a command prompt window?


(e-mail address removed)

Wouldn't it be faster to run a test than to post the question?
Left clicking on a batch file, will always open a command prompt window in
Windows.
 
Ron said:
Wouldn't it be faster to run a test than to post the question?

It's also faster to run a test than post a solution that doesn't
work. The window opens up all right, but immediately closes when the
batch file completes. I want to *stay* in the window after executing
the batch file.
Left clicking on a batch file, will always open a command prompt window in
Windows.

Now, if there were only some way to tell the window to stay open...


(e-mail address removed)
 
I think someone already covered this topic.

Start / Run, type cmd /K myApp.bat [ok]

note: the /K switch is to keep the window open

- - - - - - - - - - -
 
You may need to add the path also (the location of your batch job).
ex:
Start /Run, type cmd /k c:\myApp.bat [ok]

using NotePad, open "myApp.bat" to view contents for this sample.

cd c:\ <--- line 1
Dir <--- line 2

notes:
try it without the /K, the batch job above would close immediately.
the switch /K is to keep window open
or /C to close window when your app finish.

- - - - - - - - - - -
 
james said:
You may need to add the path also (the location of your batch job).
ex:
Start /Run, type cmd /k c:\myApp.bat [ok]

using NotePad, open "myApp.bat" to view contents for this sample.

cd c:\ <--- line 1
Dir <--- line 2

notes:
try it without the /K, the batch job above would close immediately.
the switch /K is to keep window open
or /C to close window when your app finish.

- - - - - - - - - - -
I use DOS commands inside the Command Prompt window quite a lot.
Under older versions of Windows I used to be able to execute a BAT
file auotmatically when I opened a DOS window. The BAT file would set
the path, load some TSR's, cd to a particular directory, etc.
It was easy to specify the BAT file to execute in the DOS Window
properties box.

Under Windows XP there seems to be no way to do this. Does
anyone here know how or can you point me to some documentation that
covers it? None of the 3rd party books about Windows XP that I've
looked at mention it at all.


The window opens up all right, but immediately closes when the
batch file completes. I want to *stay* in the window after executing
the batch file.

Now, if there were only some way to tell the window to stay open...

Thanks for this suggestion. This was the key that opened the magic
door. By searching for "cmd.exe" in the Help and Support facility I
found plenty of documentation on the the other command line switches
that can be specified in a similar way.

For anyone else that may be interested, I made your suggestion easier
to use by creating a shortcut on the desktop to XP's Command Prompt,
then specifying the above Start|Run command in the Shortcut|Target box
of the Properties dialog of that shortcut. That way I don't have to
constantly use the Start|Run box to get into DOS.


(e-mail address removed)
 
Back
Top