.CMD questions

S

someone watching

Can someone explain how to have a *.CMD window open, execute a program and
STAY at the command prompt?

All I know to try is this:

@echo off
calendar_popup (this is the program I want executed)

but immediately after execution the window closes (unless I put a PAUSE
statement) but I need the window to return to a command prompt (not close)

TIA
 
S

someone watching

Had to update the post as it doesn't fully explain what I'm trying to do. I
have two 'DOS' programs (which work in a CMD window) which I'd like executed
when the .CMD file is invoked, as follows:

@echo off
pushd f:\notepad
notepad (it's a popup 'dos' program invoked with a hotkey; works fine in a
typical CMD window)
calendar (another 'dos' program which pops up a very small calendar with
reminders and immediately terminates to the prompt)

trouble it the CMD window immediately terminates after executing the above.
If I use a PAUSE statement I can see the programs are launched and work as
they should ... but how to remain at a command prompt ??

TIA
 
P

Pegasus [MVP]

someone watching said:
Can someone explain how to have a *.CMD window open, execute a program and
STAY at the command prompt?

All I know to try is this:

@echo off
calendar_popup (this is the program I want executed)

but immediately after execution the window closes (unless I put a PAUSE
statement) but I need the window to return to a command prompt (not close)

TIA

Try this:
@echo off
cmd /k calendar_popup
 
G

Guest

I have a link to the cmd prompt on my quick launch bar. It stays open until
I close it. Only if cmds are put in the 'run' box does cmd shut afterwards.
Having the cmd prompt link is handy for running tracert and ipconfig -
needed quite a lot in sorting out internet connection hassles.

S
 
S

someone watching

Pegasus said:
@echo off
cmd /k calendar_popup

Tried the /k switch, works great to keep a command prompt. Now the question
is how to invoke TWO programs (in same window) and still have working CMD
prompt. I've tried all kinds on combinations of /k switches, no /k switches,
etc. No luck keeping command prompt!

any other ideas?

TIA
 
G

Guest

PS: Right clicking on the link gives you a properties sheet where you can
set it to run in a normal window of whatever size you want.

S
 
P

Pegasus [MVP]

someone watching said:
Tried the /k switch, works great to keep a command prompt. Now the
question
is how to invoke TWO programs (in same window) and still have working CMD
prompt. I've tried all kinds on combinations of /k switches, no /k
switches,
etc. No luck keeping command prompt!

any other ideas?

TIA

This sounds like a classic case of scope creep: Let's get someone to solve
one problem, then let's build on the first to solve a second and so on. Can
we have the whole scope in one fell swoop, please, instead of one little bit
at a time? You also need to spend a little more time on thinking about your
spec. When you say "two programs", do you mean two programs running
concurrently or successively? And why this insistence on keeping a Command
Processor running?
 
B

Billns

Tried the /k switch, works great to keep a command prompt. Now the question
is how to invoke TWO programs (in same window) and still have working CMD
prompt. I've tried all kinds on combinations of /k switches, no /k switches,
etc. No luck keeping command prompt!

any other ideas?

TIA
Suggest you open TWO separate command prompt windows. Run each program
in its own window. You can switch between the two windows.

Bill
 

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