Can you have multiple Boot image prestart commands?

I have got 'wscript \Deploy\Scripts\ZTIMediaHook.wsf' set as a prestart command on my boot image but I want to add another prestart command to set the date & time of the device (issued on some surface Pro's).

I created a cmd file with 'net time \\domain.co.uk /set /y' in which sets the time but I cannot add two prestart commands. What would be the best way to fire this of prestart?

September 12th, 2014 10:48am

You cannot have more than one, but you can use a single script that kicks off multiple actions.
Free Windows Admin Tool Kit Click here and download it now
September 12th, 2014 10:59am

Hi Torsten,

   ok, I created a Run.cmd & put in the root of the path for prestart. pointed to the restart.cmd in the boot image (cmd /k run.cmd). Then put my command to set the time & the execution of wscript.exe \Deploy\Scripts\ZTIMediaHook.wsf in it. It didn't work.

What is the best place to locate the files & file format for execution? iee cmd, vbs etc

September 12th, 2014 11:53am

Why call one batch file from another batch file instead of just merging the two?

Also cmd /k launches the command prompt without exiting and so the caller is never notified that it finishes effectively creating a hang.

Free Windows Admin Tool Kit Click here and download it now
September 12th, 2014 1:08pm

Sorry Jason,

  I only had 1 batch file. Run.cmd. had two lines in it. I did originally have cmd /c before trying k.

net time \\domain.co.uk /set /y

'wscript \Deploy\Scripts\ZTIMediaHook.wsf

The TS said it couldnt run 'cmd /c run.cmd'. I dont think it could find it, do these files get copied locally as I could locate it navigating x:\

PS, what is it with microsoft forums & IE 11? I have to use chrome to create,reply or edit on here.

  • Edited by ebcMark Friday, September 12, 2014 1:44 PM
September 12th, 2014 1:43pm

you can have multiple commands in a prestart all separated by the & symbol like I show below

cmd.exe /c echo  192.168.0.1 p01.domain.lab.local >> x:\windows\system32\drivers\etc\hosts & cmd.exe /c echo  192.168.0.2 p02.domain.lab.local >> x:\windows\system32\drivers\etc\hosts

Free Windows Admin Tool Kit Click here and download it now
September 13th, 2014 10:19pm

to expand on this, you actually can run multiple scripts without using another script to call them, and do so via the same trick I posted above for running multiple commands,

for example if you have two scripts prestart1.vbs and prestart2.vbs and you want to start both of them in that order in the prestart do as follows:

cmd.exe /c cscript.exe prestart1.vbs & cscript.exe prestart2.vbs

cool!

cheers

niall


April 10th, 2015 10:44am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics