4

I have a Windows 7 image used to deploy with WDS. We like to install all our applications in the master image. The new Adobe CS6 suite needs to be serialized upon deployment, not in the master image.

I need to run this once upon first boot of the initial deployment. The command to run is:

AdobeSerialization.exe --tool=VolumeSerialize

I know that command works when I run it manually, I just can't get it to run automatically, once, on first boot.

We already have this script that runs and installs our AV client and a few other items: c:\Windows\Setup\Scripts\SetupComplete.cmd

I have copied AdobeSerialization.exe to c:\Windows\Setup\Scripts\ but it does not seem to run.

What's the recommended approach to running this script only once, during first boot?

2 Answers 2

6

Try making it into an actual script:
In notepad create the file AdobeSerialization.cmd and add the lines:

@echo off
start /d "path_to_file" AdobeSerialization.exe --tool=VolumeSerialize
del AdobeSerialization.cmd

Then move your script AdobeSerialization.cmd to C:\Windows\Setup\Scripts\

In the last line of the script the file deletes itself to prevent it from ever being run again. Alternatively you can move the script to another location if you do not want it removed from the machine by changing the last line to:

move AdobeSerialization.cmd "new_path"
2
  • 1
    >> move AdobeSerialization.cmd "new_path" Does that really work? The file is probably locked during execution....? Might be better to stash a value in the registry: ScriptHasRun Then the script simply checks registry, and doesn't run if the reg tag is there. Jun 4, 2012 at 18:10
  • 2
    No, you need two files: A small stub that runs the larger file, and the larger one is moved by the smaller one. Or find another way to make it conditional to run the file at all. (like a Windows task that is a one-time run task). Jun 4, 2012 at 22:03
2

Consider use of the RunOnce Registry key under the HKLM hive so it will run once for whichever user is first to log in.

http://msdn.microsoft.com/en-us/library/aa376977%28v=vs.85%29.aspx

Set this in Master image and upon first boot, your command can be executed. Windows takes care to delete the registry key.

EDIT (thanks to @guss) - RunServicesOnce (at same link as above) is run once per boot, not waiting for user to login. In cases where a user login should not be required, that key seems the right choice.

1
  • 2
    RunOnce run on user login, not on boot - so it is inappropriate for jobs that need to run on unattended system start.
    – Guss
    Sep 22, 2015 at 14:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .