Game Development Community

executing a .bat file from a script

by Ian Wheat · in Torque Game Engine · 12/17/2001 (1:14 pm) · 4 replies

I have a .bat file that deletes all the .dso files in my /fps/client/ui dir. and I want it to be executed whenever I open the GUI Editor.

is there a way to do this?

#1
12/18/2001 (8:52 am)
Nope. Allowing scripts to execute files would be a big security problem.

Josh
#2
12/18/2001 (9:35 am)
call a dos command to execute the batch file.. cant remember what the windows call to execute a dos command is. take a look at spawn, there might be a lead from there..

I seem to remember it being something like OpenXXX but cant remember the XXX :(

Ah well, not much help here. But basically you can just call a windows function to run the batch file as a dos command.

Phil.
#3
12/18/2001 (3:07 pm)
Oh, I thought he was asking about calling his batch file from script. If you want to call it from C++, use CreateProcess (or the more simple WinExec).

For more info on those two, check out MSDN.

Josh
#4
01/04/2002 (10:37 am)
I created a batch file that deletes all *.dso files before it loads up the game .exe

looks kinda like this ( make sure it's in the same folder as the .exe ):

del /s *.dso
call torqueDemo_DEBUG.exe

or whatever the .exe name is