I'm testing this sample batch file using the /k switch
cmd.exe /k winver
pause
However, once it runs winver it is back to the command prompt. How do I setup batch file to continue processing commands?
Thanks in advance.
Batch file does not continue running commands
Moderator: DosItHelp
Re: Batch file does not continue running commands
That is a loaded question. You need to better explain what your real task is and why you think you need to use CMD /k.
Because you seem to want to use CMD /K, this would be your only option.
So you need to explain why you wouldn't just run this?
Or this
Because you seem to want to use CMD /K, this would be your only option.
Code: Select all
@ECHO OFF
cmd.exe /k "winver &exit"
PAUSE
Code: Select all
@ECHO OFF
cmd.exe /c "winver"
PAUSE
Code: Select all
@ECHO OFF
winver
PAUSE
Re: Batch file does not continue running commands
Thanks Squashman, it worked great.