Jump to content

Environment variables don't work in XML unattended file


Recommended Posts

I have this section in my Autounattend.xml unattended answer file:

			<FirstLogonCommands>
<SynchronousCommand wcm:action="add">
<CommandLine>REGEDIT /S C:\WINDOWS\system32\tweak.reg</CommandLine>
<Description>RegEntries</Description>
<Order>1</Order>
</SynchronousCommand>
</FirstLogonCommands>

So this is only any use if you install on a C:\ drive, so I change it to this:

			<FirstLogonCommands>
<SynchronousCommand wcm:action="add">
<CommandLine>REGEDIT /S %WINDIR%\system32\tweak.reg</CommandLine>
<Description>RegEntries</Description>
<Order>1</Order>
</SynchronousCommand>
</FirstLogonCommands>

And it does not work!

These XML methods suck, this was never a problem in XP with WINNT.SIF, you just

used %SYSTEMDRIVE% or %WINDIR% and it worked, not in Vista though. I thought

things were supposed to get better and easier, not worse and harder?

Edited by LeveL
Link to comment
Share on other sites


Hello LeveL!

use cmd /c in front of your command and it will work again:

<FirstLogonCommands>
<SynchronousCommand wcm:action="add">
<CommandLine>cmd /c REGEDIT /S %WINDIR%\system32\tweak.reg</CommandLine>
<Description>RegEntries</Description>
<Order>1</Order>
</SynchronousCommand>
</FirstLogonCommands>

Regards,

Martin

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Recently Browsing   0 members

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