Computing.Net > Forums > Disk Operating System > Need help in a dos batch file

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Need help in a dos batch file

Reply to Message Icon

Name: Venky
Date: December 22, 2002 at 05:31:44 Pacific
OS: Windows 2000
CPU/Ram: P3
Comment:

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!




Sponsored Link
Ads by Google

Response Number 1
Name: SpiderMSN
Date: December 22, 2002 at 05:40:14 Pacific
Reply:

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 :)


0

Response Number 2
Name: Secret_Doom
Date: December 22, 2002 at 10:52:23 Pacific
Reply:

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


0

Response Number 3
Name: Wengier
Date: December 22, 2002 at 13:28:56 Pacific
Reply:

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.


0

Response Number 4
Name: Wengier
Date: December 22, 2002 at 13:38:40 Pacific
Reply:

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.


0

Response Number 5
Name: SpiderMSN
Date: December 22, 2002 at 17:44:32 Pacific
Reply:

I have XP so I'm asking this purly out of interest: would that work for people with ME?


0

Related Posts

See More



Response Number 6
Name: Thepulsar
Date: December 25, 2002 at 14:57:32 Pacific
Reply:

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"


0

Response Number 7
Name: Venky
Date: January 1, 2003 at 23:31:07 Pacific
Reply:

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!


0

Sponsored Link
Ads by Google
Reply to Message Icon






Post Locked

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


Go to Disk Operating System Forum Home


Sponsored links

Ads by Google


Results for: Need help in a dos batch file

Need help with a Dos batch file www.computing.net/answers/dos/need-help-with-a-dos-batch-file/13006.html

archive in dos batch file www.computing.net/answers/dos/archive-in-dos-batch-file/12924.html

Quick! Know dos? batch files? help! www.computing.net/answers/dos/quick-know-dos-batch-files-help/4231.html