• Welcome to Tux Reports: Where Penguins Fly. We hope you find the topics varied, interesting, and worthy of your time. Please become a member and join in the discussions.

.CMD questions

S

someone watching

Flightless Bird
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
 
P

Pegasus [MVP]

Flightless Bird
"someone watching" <nospam@bogusaddress.com> wrote in message
news:-OPgh7YG6KHA.6052@TK2MSFTNGP02.phx.gbl...
> 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
 
S

someone watching

Flightless Bird
Re: UPDATE on .CMD questions

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
 
S

spamlet

Flightless Bird
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


"someone watching" <nospam@bogusaddress.com> wrote in message
news:-OPgh7YG6KHA.6052@TK2MSFTNGP02.phx.gbl...
> 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

Flightless Bird
"Pegasus [MVP]" <news@microsoft.com> wrote in message Try this:
> @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
 
S

spamlet

Flightless Bird
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

"spamlet" <spam.morespam@invalid.invalid> wrote in message
news:%235bdBMH6KHA.5016@TK2MSFTNGP02.phx.gbl...
>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
>
>
> "someone watching" <nospam@bogusaddress.com> wrote in message
> news:-OPgh7YG6KHA.6052@TK2MSFTNGP02.phx.gbl...
>> 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
>>
>>

>
>
 
P

Pegasus [MVP]

Flightless Bird
"someone watching" <nospam@bogusaddress.com> wrote in message
news:-OqvfeaH6KHA.328@TK2MSFTNGP05.phx.gbl...
> "Pegasus [MVP]" <news@microsoft.com> wrote in message Try this:
>> @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
>


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

Flightless Bird
On 4/30/2010 8:05 AM, someone watching wrote:
> "Pegasus [MVP]"<news@microsoft.com> wrote in message Try this:
>> @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
>
>

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

Bill
 
Top