Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
up vote 4 down vote accepted

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"
share|improve this answer
>> 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. – samsmith Jun 4 '12 at 18:10
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). – samsmith Jun 4 '12 at 22:03

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

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.

share|improve this answer
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 '15 at 14:42

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.