Jump to content

run a command in autounattend.xml


Recommended Posts


Hi,

Is there any way to run a command in autounattend.xml. For example, i want to run "del c:\xyt.txt" at the end of installation. Is there any way to directly give the command from autounattend.xml?

thanks..

srihariram, yes, please see 'SetupComplete.cmd' in the waik.chm help file. Enjoy, John.

Link to comment
Share on other sites

Thanks for the reply john..

I boot through winpe (already copied to HD) and start the windows setup from DVD.

I can copy files only after winpe boots. That time there is no directory structure %WINDIR%\Setup\Scripts\SetupComplete.cmd .

Can i make this directory structure after winpe boots and update the setupcomplete.cmd? Will this way work or any other place that i can copy setupcomplete.cmd.

regards..

Link to comment
Share on other sites

Thanks for the reply john..

I boot through winpe (already copied to HD) and start the windows setup from DVD.

I can copy files only after winpe boots. That time there is no directory structure %WINDIR%\Setup\Scripts\SetupComplete.cmd .

Can i make this directory structure after winpe boots and update the setupcomplete.cmd? Will this way work or any other place that i can copy setupcomplete.cmd.

regards..

srihariram, sorry I cannot answer your questions. I use 'SetupComplete.cmd' to run a command after first login (file structure is in place) in a flat install (from HDD). I do not use WinPE and am not familiar with it. I would suggest running some experiments in a virtual machine. I use VMware Player. It is free and easy to use. Enjoy, John.

Link to comment
Share on other sites

1) Maybe you can customize your Windows DVD and use this one!

2)Customization of the DVD Windows for the unattended installation.

You can create the folders:

$OEM$\SETUP\SCRIPITS\SetupComplete.cmd inside sources (inside the folder where are located your Windows 7 folders).

Example with a command "WPI.cmd" inside the folder "SCRIPTS"

Inside your "Autounattend.xml" you can add the path of your command:

Example for Windows 7 Ultimate x86:


<settings pass="oobeSystem">

<FirstLogonCommands>
<SynchronousCommand wcm:action="add">
<Order>1</Order>
<Description>Password never expires</Description>
<CommandLine>cmd /C wmic useraccount where "name='myselfidem'" set PasswordExpires=FALSE</CommandLine>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>2</Order>
<Description>Install Applications with WPI</Description>
<CommandLine>cmd /C start /wait c:\Windows\Setup\scripts\WPI.cmd</CommandLine>
</SynchronousCommand>
</FirstLogonCommands>

You can find more help inside: Unattended Windows Setup Reference for Windows 7.chm

Windows Automated Installation Kit for Windows 7 documentation (May 2010 Update)

Edited by myselfidem
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...