Author |
Message |
Dan LeBla #1 / 11
|
 ending a DOS shell after execution
Quote: > Can someone give me a DOS command that will get rid of the shell or else > tell me another way to take care of the problem?
did you try exit? heheh well.. you could go to http://www.*-*-*.com/ and download the OXE that allows you to kill any app via the windows 'end task' Dan
|
Thu, 12 Apr 2001 02:00:00 GMT |
|
 |
Matthew Crome #2 / 11
|
 ending a DOS shell after execution
Hi everyone. I am using VB to front-end some DOS operations, including XCOPY. The problem I have is, after the operations are done, I am left with the DOS window, it says the program is ended, but I want the dos window to go away. The program creates, then runs a batch file "xxx.bat" via shell Every time the timer runs again, I get another shell window left open--clearly this will consume resources on the server. Can someone give me a DOS command that will get rid of the shell or else tell me another way to take care of the problem? Thanks, Matthew Cromer
|
Fri, 13 Apr 2001 03:00:00 GMT |
|
 |
Murray Thay #3 / 11
|
 ending a DOS shell after execution
Quote: >Hi everyone. >I am using VB to front-end some DOS operations, including XCOPY.
Hello Mathew Dim cmd as string cmd = environ$("COMSPEC") & " /c" cmd = cmd & "yourfile.bat" shell cmd the comspec part reurns either command.com (95) or cmd.exe (NT) the /c csues the dos app to close on completion best wishes, Murray
|
Fri, 13 Apr 2001 03:00:00 GMT |
|
 |
Todd #4 / 11
|
 ending a DOS shell after execution
As long as your using a batch file just make CLS the last line. Quote:
>>Hi everyone. >>I am using VB to front-end some DOS operations, including XCOPY. >Hello Mathew >Dim cmd as string >cmd = environ$("COMSPEC") & " /c" >cmd = cmd & "yourfile.bat" >shell cmd >the comspec part reurns either command.com (95) or cmd.exe (NT) >the /c csues the dos app to close on completion >best wishes, Murray
|
Fri, 13 Apr 2001 03:00:00 GMT |
|
 |
LMir #5 / 11
|
 ending a DOS shell after execution
Do you have to see the result of that operations? If don't, try this. Shell "YourBatchFile", vbHide Quote:
>Hi everyone. >I am using VB to front-end some DOS operations, including XCOPY. >The problem I have is, after the operations are done, I am left with the >DOS window, it says the program is ended, but I want the dos window to go >away. >The program creates, then runs a batch file "xxx.bat" via shell >Every time the timer runs again, I get another shell window left >open--clearly this will consume resources on the server. >Can someone give me a DOS command that will get rid of the shell or else >tell me another way to take care of the problem? >Thanks, >Matthew Cromer
|
Fri, 13 Apr 2001 03:00:00 GMT |
|
 |
Matthew Crome #6 / 11
|
 ending a DOS shell after execution
Quote:
>Dim cmd as string >cmd = environ$("COMSPEC") & " /c" >cmd = cmd & "yourfile.bat" >shell cmd >the comspec part reurns either command.com (95) or cmd.exe (NT) >the /c csues the dos app to close on completion >best wishes, Murray
Thanks Murray, that worked. Can someone tell me what it does? I don't know what environ$ is. Thanks. Matthew Cromer
|
Sat, 14 Apr 2001 03:00:00 GMT |
|
 |
Jon #7 / 11
|
 ending a DOS shell after execution
environ$ is an (system) environment variable..... Quote:
>>Dim cmd as string >>cmd = environ$("COMSPEC") & " /c" >>cmd = cmd & "yourfile.bat" >>shell cmd >>the comspec part reurns either command.com (95) or cmd.exe (NT) >>the /c csues the dos app to close on completion >>best wishes, Murray >Thanks Murray, that worked. >Can someone tell me what it does? I don't know what environ$ is. >Thanks. >Matthew Cromer
|
Sat, 14 Apr 2001 03:00:00 GMT |
|
 |
LoneSta #8 / 11
|
 ending a DOS shell after execution
Quote:
> environ$ is an (system) environment variable.....
and can be found in the help file under "Environ function" Quote:
> >>Dim cmd as string > >>cmd = environ$("COMSPEC") & " /c" > >>cmd = cmd & "yourfile.bat" > >>shell cmd > >>the comspec part reurns either command.com (95) or cmd.exe (NT) > >>the /c csues the dos app to close on completion > >>best wishes, Murray > >Thanks Murray, that worked. > >Can someone tell me what it does? I don't know what environ$ is. > >Thanks. > >Matthew Cromer
|
Sat, 14 Apr 2001 03:00:00 GMT |
|
 |
Matthew Crome #9 / 11
|
 ending a DOS shell after execution
Quote:
>Do you have to see the result of that operations? >If don't, try this. >Shell "YourBatchFile", vbHide
The problem with this is, it leaves a dos window behind every time the timer backs up the files, so you quickly get hundreds of dos windows eating system resources. Matthew
|
Sun, 15 Apr 2001 03:00:00 GMT |
|
 |
Bob Butle #10 / 11
|
 ending a DOS shell after execution
Quote:
<cut> >> The problem with this is, it leaves a dos window behind every time the >> timer backs up the files, so you quickly get hundreds of dos windows >> eating system resources. >Simple! Put an EXIT command at end!!
That doesn't work if your system is not set up for 'Close on Exit' by
Cls Since 'Close on Exit' is assumed if the end screen display is completely blank. You can also control it via the Shell call with something like: x=Shell(Environ$("comspec") & " /c mybatfile myargs",vbNormalFocus) The Environ$ function makes it work for both 95 & NT and the /c causes it to run the one command line and then close.
|
Tue, 17 Apr 2001 03:00:00 GMT |
|
|