Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Question
Thursday, March 16, 2017 3:54 PM
Hi all,
I have sysprepped my windows machine. I decided to place my Autounattend.xml on a USB-Stick in order to be able to change the configuration at any time, without changing the sysprepped image.
Now I would like to place a script on my USB-Stick where the Autounattend.xml lies. Perhaps the script should be executed as a FirstLogonCommand.
So a FirstLogonCommand would have the CommandLine value of: cmd.exe /c pathToScriptOnUsb/myScript.vbs
Any ideas on how I can do something like that? The main goal of this is to be able to change the Autounattend.xml and the batch file without touching the sysprepped image itself.
Thanks,
Jason
All replies (4)
Monday, March 27, 2017 9:39 AM âś…Answered | 1 vote
I actually finally found a solution.
In specialize pass I added the Micosoft Windows Deployment component and in that I added the following:
<component name="Microsoft-Windows-Deployment" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<RunSynchronous>
<RunSynchronousCommand wcm:action="add">
<Order>1</Order>
<Description>Set InstallDrive environment variable</Description>
<Path>cmd /c FOR %i IN (C D E F G H I J K L N M O P Q R S T U V W X Y Z) DO IF EXIST %i:\InstallDrive.tag SETX InstallDrive %i:\ -m</Path>
</RunSynchronousCommand>
</RunSynchronous>
</component>
On my USB-Stick I created a file called InstallDrive.tag as an indicator.
So now I can access my USB-Stick like that:
cmd /c %InstallDrive%\Software\OFFICE14\setup.exe
Friday, March 17, 2017 2:53 AM
Hi Jason,
You just add FirstLogonCommans shell into answer file.
Here is an example shows how to specify two commands to run after first logon.
FirstLogonCommands
Please remember to mark the replies as answers if they help.
If you have feedback for TechNet Subscriber Support, contact [email protected].
Friday, March 17, 2017 7:14 AM
Hi Karen,
Thanks for your reply.
How do i know the drive letter of my USB-Stick? I only know that my script is on the same USB-Stick like my Autounattend.xml
Friday, March 17, 2017 9:22 AM
Hi Karen,
Thanks for your reply.
How do i know the drive letter of my USB-Stick? I only know that my script is on the same USB-Stick like my Autounattend.xml
Save the file as Autounattend.xml on the root of a USB flash drive.
On a new PC, put in the Windows product DVD and the USB flash drive, and then boot the PC. When no other answer file is selected, Windows Setup searches for this file.
You can select a specific answer file during installation by booting to the Windows Preinstallation Environment, and using the setup.exe command with the **/unattend:**filename option.
Please remember to mark the replies as answers if they help.
If you have feedback for TechNet Subscriber Support, contact [email protected].