PDA

View Full Version : can Setup Factory run Batch files?


ultraz57
09-14-2006, 12:39 PM
like the title says, can it run batch files? if so, how?

Brett
09-14-2006, 12:58 PM
Use the File.Open action.

ultraz57
09-14-2006, 12:59 PM
will that run the batch file or just open it?

Brett
09-14-2006, 01:01 PM
It should run it. It does an Open shell verb on it which means run it for a batch file.

ultraz57
09-14-2006, 01:07 PM
what about in SF6? I have both versions, but I have it in 6 right now.... do I need to bring it over into SF7?

Adam
09-14-2006, 01:13 PM
In 6.0 use Actions -> Open/Close Programs -> Open Document.

Adam Kapilik

Eagle
09-14-2006, 03:02 PM
For SUF70:

please correct me if required:

File.Open does not wait for a batch file to complete.

File.Run gives much more control (eg the 'wait' parameter)

ultraz57
09-14-2006, 03:03 PM
I was trying to find a way to make it wait also... I couldn't even find a winwait or anything.... I'm trying to use this as a wrapper and I'm deleteing the files at the end of the installation.... my only other option that I can think of is to just have the files delete at reboot....

ideas?

Eagle
09-14-2006, 03:09 PM
have a look into the batch command START /WAIT

at a command prompt type START /?

hth

you could also run a .bat or .cmd file at the very end of 'on shutdown' event
but need to cover if a reboot is needed.

also have a look inti the PING /? command
(if set output to null) >nul this can be used to pause a batch file for n seconds)
--maybe NT only for this one though.

have a look here also:
http://www.indigorose.com/forums/showthread.php?t=16965


hth

ultraz57
09-14-2006, 03:14 PM
the batch file waits... the problem is the package will continue to run and will complete way before the batch file does.... and the end of the package I have it delete all of the files that the batch file is using.

Eagle
09-14-2006, 03:18 PM
Yep, the trick is to make actions wait untill the .bat has fully exited ..

personally, if you have SUF70 - if practical for you ...

convert Suf6 project-s to SUF70 - opens up many more Possibilities as we know. ;)

you will be able to handle batch files with more power..which it seems is what you need for this one

ultraz57
09-15-2006, 10:10 AM
In 6.0 use Actions -> Open/Close Programs -> Open Document.

Adam Kapilik

ok, I tried doing the open document and nothing.... I verified that that batch file is fine even after placed in the proper directory.... are you sure open document will execute a batch file?

sepp
03-12-2008, 05:48 AM
Hi,
I'm trying this for hours and I can't get it to work. After my setup installed the files a specific batch file needs to be started from the installation folder. So I set the "On Shutdown" code to this:

File.Open("%AppFolder%\\unpack.bat");

My problem is, that the batch will be started from the Tempfolder instead of the installation folder. How can I get this to work? :(

Lorne
03-12-2008, 01:46 PM
Try setting the working folder:

File.Open("%AppFolder%\\unpack.bat", SessionVar.Expand("%AppFolder%"));