Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hi,
I'm trying to run a EXE file from with in a batch file ( A terminal server connection to be presise.)
But the batch file dose not process commands after this line till the exe file is closed.
Is there a way I can just start this program and make the batch file continue with the processing of the rest of the batch file?
Thanks!

Yep, you use the CALL command (I think call was originally intednded for calling other batch files, but exe files that don't return control to the batch file can be fixed by using call). To use you just put CALL before the command. Not many EXEs are like this I might add and it's interesting when you come across them :)

Yep, the CALL cmd was made to execute batch files from withing other batch files. I had never seen a .EXE/.COM that stoped the batch script's activities from then on (except for WIN.COM, but that's a very peculiar case hehe).
In case the CALL trick ("call filename.exe") doesn't work, you may also execute the .exe from a child shell:
%comspec% /c filename.exe
-- Leonardo Pignataro - Secret_Doom --
secret_doom@hotmail.com
www.batch.hpg.com.br

WIN.COM works too if you select "shut down the computer" without the ACPI power(Note:it doesn't work if you select "Restart the computer and switch to MS-DOS mode",because this doesn't leave WIN.COM from memory completely).I have seen some articles about this.

And if you have the ACPI power,then load NOOFF.COM before loading WIN.COM,and it will not shut down as if no ACPI power present.
You can make the following batch file to verify this:
@ECHO OFF
NOOFF
WIN.COM
MODE CO80
ECHO Now I'm in DOS mode!Run it.Now you can select "Shut down" in Windows,and see the result.

With recent version of Windows, you can't use all function of DOS, and most of file work only in windows, If in your batch file you use "@echo off", it's possible DOS not print this message "CANNOT BE RUN IN DOS MODE"

Hi all,
Thanks a Lot for your response!!
I found that the terminal services client stops the processing of the batch file when using both Call command as well as using the %comspec% /c filename.exe method. I will need to exit / close the Terminal server session before the batch process continues .
( I'm using Win2K )
How ever, I found that the "START" method will work well - It starts the EXE and returns executing the batch file.
One tricky thing about start is it doesn't seem to recognize long file names of Win2k - so you will need to specify the file in the old dos way some thing like -start D:\PROGRA~1\TERMIN~1\MSTSC.exe
This will just start the program and continue the processing of the batch.
Thanks again!

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |