BBQmyNUTZ Posted December 10, 2004 Share Posted December 10, 2004 Still new to this, but I've been making considerable progress. Managed to get my first unattended install on my laptop working perfectly, so now I'm moving on to the desktop.The only thing I'm doing differently is adding more programs, and I would like to add in the WinXPTaskbar registry tweak. However, for one reason or another, the user account I defined in UserAccounts.cmd and Autologon.reg is being created as a limited account. When the programs defined in RunOnceEX start to install, they all pull lack of priviledge errors. I then have to log off the created account, into the passworded:(Here's what I've got, let me know if you see anything out of whack.Winnt.sif;SetupMgrTag[Data] AutoPartition=0 MsDosInitiated="0" UnattendedInstall="Yes" AutomaticUpdates=no[Unattended] UnattendMode=FullUnattended OemSkipEula=Yes OemPreinstall=Yes TargetPath=\WINDOWS Repartition=No FileSystem=* UnattendSwitch="Yes" WaitForReboot="No" DriverSigningPolicy=Ignore NonDriverSigningPolicy=Ignore[GuiUnattended] AdminPassword=************************ EncryptedAdminPassword=Yes OEMSkipRegional=1 TimeZone=35 OemSkipWelcome=1[Display] ConfigureAtLogon=0 AutoConfirm=1 BitsPerPel=32 Xresolution=1280 Yresolution=1024 Vrefresh=75[UserData] ProductKey=XXXXX-XXXXX-XXXXX-XXXXX-XXXXX FullName="First Last" OrgName="" ComputerName=first[TapiLocation] CountryCode=1[RegionalSettings] LanguageGroup=13,17,3,2,5,16,4,12,15,7,8,10,11,9,6,14,1[Identification] JoinWorkgroup=WORKGROUP[Networking] InstallDefaultComponents=Yescmdlines.txt[COMMANDS]"RunOnceEx.cmd""Cleanup.cmd""UserAccounts.cmd"RunOnceEX.cmdSET KEY=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceExREG ADD %KEY%\001 /VE /D "Adobe Acrobat Reader 6.0.1" /fREG ADD %KEY%\001 /V 1 /D "%systemdrive%\Install\Applications\ACROBAT\setup.msi /qn" /fREG ADD %KEY%\002 /VE /D "Adobe Photoshop CS" /fREG ADD %KEY%\002 /V 1 /D "%systemdrive%\Install\Applications\PHOTOSHOP\setup.exe /r /s" /fREG ADD %KEY%\003 /VE /D "ACDSee 7" /fREG ADD %KEY%\003 /V 1 /D "%systemdrive%\Install\Applications\ACDSee\setup.msi /QB PIDKEY=XXXXXX-XXXXX-XXXXXX-XXXXXXX LICENSE_MODEL=Full" /fREG ADD %KEY%\004 /VE /D "AOL Instant Messenger 5.9" /fREG ADD %KEY%\004 /V 1 /D "%systemdrive%\Install\Applications\AIM\setup.exe /s /v/qn" /fREG ADD %KEY%\005 /VE /D "Java2 Platform SE" /fREG ADD %KEY%\005 /V 1 /D "%systemdrive%\Install\Applications\JAVA\setup.exe /s /v/qn" /fREG ADD %KEY%\006 /VE /D "Lexmark X1100 Drivers" /fREG ADD %KEY%\006 /V 1 /D "%systemdrive%\Install\Drivers\Printer\WIN_XP2K\ENGLISH\setup.exe" /fREG ADD %KEY%\007 /VE /D "Microsoft Office XP SP-3" /fREG ADD %KEY%\007 /V 1 /D "%systemdrive%\Install\Applications\OFFICEXP\PROPLUS.msi /qb" /fREG ADD %KEY%\008 /VE /D "Nero Burning ROM 6" /fREG ADD %KEY%\008 /V 1 /D "REGEDIT /S %systemdrive%\Install\Applications\NERO\register.reg" /fREG ADD %KEY%\008 /V 2 /D "%systemdrive%\Install\Applications\NERO\setup.exe /silent /noreboot" /fREG ADD %KEY%\009 /VE /D "Nero Burning ROM 6 Manual" /fREG ADD %KEY%\009 /V 1 /D "%systemdrive%\Install\Applications\NERO\setupm.exe /silent /noreboot" /fREG ADD %KEY%\010 /VE /D "PowerDVD 6" /fREG ADD %KEY%\010 /V 1 /D "%systemdrive%\Install\Applications\POWERDVD\setup.exe -s" /fREG ADD %KEY%\011 /VE /D "Quicktime 6.5" /fREG ADD %KEY%\011 /V 1 /D "%systemdrive%\Install\Applications\QUICKTIME\QuickTimeFullInstaller.exe /verysilent /sp-" /fREG ADD %KEY%\012 /VE /D "Windows Media Player 10" /fREG ADD %KEY%\012 /V 1 /D "%systemdrive%\Install\Applications\WMP10\setup.exe /q" /fREG ADD %KEY%\013 /VE /D "WinRAR 3.20" /fREG ADD %KEY%\013 /V 1 /D "%systemdrive%\Install\Applications\WINRAR\setup.exe /s" /fREG ADD %KEY%\014 /VE /D "3D Windows XP Screensaver" /fREG ADD %KEY%\014 /V 1 /D "%systemdrive%\Install\Applications\SCREENSAVER\3DwindowsXP.exe /q" /fREG ADD %KEY%\020 /VE /D "Cleaning Up and Rebooting" /fREG ADD %KEY%\020 /V 1 /D "%SYSTEMDRIVE%\Install\cleanup.cmd" /fCleanup.cmdSET KEY=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceExREG ADD %KEY%\030 /VE /D "Delete Work Directory" /fREG ADD %KEY%\030 /V 1 /D "%windir%\system32\cmd.exe /c rd /s /q """%systemdrive%\Install\""" /fshutdown.exe -r -f -t 0UserAccounts.cmdnet user "User" /addnet localgroup Administrators "User" /addnet accounts /maxpwage:unlimitedREGEDIT /S AutoLogon.regEXITAutologon.regWindows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon]"DefaultUserName"="User""AutoAdminLogon"="1"I didn't post the RegTweak.reg call, which as far as I know should go into RunOnceEx.cmd. autologon.reg, cmdlines.txt, useraccounts.cmd, and runonceex.cmd are all in the $OEM$ folder. Cleanup.cmd is in $OEM$\$1\Install\.If there's any other information I can give you to help me diagnose the malfunction, I would really appreciate it.Kai Link to comment Share on other sites More sharing options...
Alanoll Posted December 10, 2004 Share Posted December 10, 2004 first off, try removing the " around User, and try a different name besides User.second, you cleanup.cmd won't import the RunOnceEX keys properly. You have embedded quotes without escaping them. Link to comment Share on other sites More sharing options...
BBQmyNUTZ Posted December 10, 2004 Author Share Posted December 10, 2004 first off, try removing the " around User, and try a different name besides User.second, you cleanup.cmd won't import the RunOnceEX keys properly. You have embedded quotes without escaping them.I wasn't actually using "User" as the account name... it was just an example.The cleanup.cmd file seems to be working ok, it does what it's supposed to do... what does "embedded quotes without escaping them" mean? And how would it effect the way another cmd file works?Kai Link to comment Share on other sites More sharing options...
BBQmyNUTZ Posted December 11, 2004 Author Share Posted December 11, 2004 I managed to get it to work, and came across something I don't think I've seen posted here. Feel free to correct me if I'm wrong.I set some pauses and just tried to add the username through useraccounts.cmd. Here's what I got:D:\XPDVD-KIKI\$OEM$>net localgroup Administrators "Kiki" /addSystem error 1317 has occurred.The specified user does not exist.Well, yah.. duh. I deleted the limited account before running it... of course it didn't exist. I thought maybe it didn't like the sequence of the letters or something, so I changed all instances of "Kiki" to "Test". Sure enough, it created the admin account just fine. So, does my computer not like my sister's name?I didn't think much of it, but I remembered that I set the "Computer Name" to "kiki" in winnt.sif, and decided to change it... just in case. Changed the names in useraccounts.cmd, and BAM!, now it's working.Coincidence, or can anyone else confirm that creating an account in this way will pull that error if the account name used is the same as the name of the computer?Kai Link to comment Share on other sites More sharing options...
bmn Posted December 11, 2004 Share Posted December 11, 2004 have a look at my settings.its working fine for mewinnt.sif:--;; Generated by nLite 0.99.1 beta 2;[Data] MsDosInitiated = 0 UnattendedInstall = Yes[unattended] UnattendSwitch = Yes OemPreinstall = Yes OemSkipEula = Yes FileSystem = * WaitForReboot = No TargetPath = "\Windows" DriverSigningPolicy = Ignore NonDriverSigningPolicy = Ignore Hibernation = No[GuiUnattended] AutoLogon = No AdminPassword = * TimeZone = 190 OEMSkipRegional = 1 OemSkipWelcome = 1[userData] ProductKey = "xxxxxxxxx" ComputerName = "MACHINE" FullName = "xxxxxxxxx" OrgName = "Universal"[RegionalSettings] Language = 0409[identification] JoinWorkgroup = maker;[shell];CustomDefaultThemeFile="%Systemroot%\Resources\Themes\crystal.theme"user.cmd:--NET USER "owner" /addNET LOCALGROUP Administrators "owner" /AddREM Autologon first bootREGEDIT /S %cdrom%\Install\autologon.regEXITautologon.reg:--Windows Registry Editor Version 5.00[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon]"DefaultUserName"="Owner""DefaultPassword"="""AutoAdminLogon"="0"autologon is working with these settings with out any error.and iam using home sp2.i dono why but if i change autologon in [GuiUnattended] to yes.this autologon is failing ang giving some error just play aroung ur winnt.sif settings.if might work Link to comment Share on other sites More sharing options...
^_^ Posted December 11, 2004 Share Posted December 11, 2004 Seems you figured it out all by yourselfIt's true, the username cannot be the same as the computer name Link to comment Share on other sites More sharing options...
Astalavista Posted December 11, 2004 Share Posted December 11, 2004 I just want to say winrar is your friend.with winrar u can repack nero so that u can save space, and place the switch into the comment. so u dont need to add switches anymore to your runonceEx.cmd.same with winrar and powerdvd.cheers Link to comment Share on other sites More sharing options...
BBQmyNUTZ Posted December 11, 2004 Author Share Posted December 11, 2004 I just want to say winrar is your friend.with winrar u can repack nero so that u can save space, and place the switch into the comment. so u dont need to add switches anymore to your runonceEx.cmd.same with winrar and powerdvd.cheersFigure I may as well learn the long way around first. ^_^Would be interested in seeing some examples though... I haven't been able to figure out how WinRar's SFX functions work yet.Kai Link to comment Share on other sites More sharing options...
Cartoonite Posted December 11, 2004 Share Posted December 11, 2004 (edited) i dono why but if i change autologon in [GuiUnattended] to yes.this autologon is failing ang giving some errorI believe it causes a problem because setting AutoLogon in [GuiUnattended] as well as executing your autologon.reg registry tweaks configures the pc to automatically logon with two seperate accounts. The following is taken from the copy of ref.chm distributed with SP2 Deployment Tools:AutoLogonConfigures the computer to log on once with the Administrator account.Syntax AutoLogon = Yes | No Values Yes Configures the computer to log on once with the Administrator account.No Does not automatically log on to the computer.Default Value NoAs you can see, AutoLogon in [GuiUnattended] tells the PC to automatically log in using the built-in Administrator account after the first boot. You then inport your autologon.reg tweaks telling the computer to automatically log in using the Owner account that you created. I suspect this conflict is what is generating your errors.I also see that you have "AutoAdminLogon"="0" in your autologon.reg file, where I use "AutoAdminLogon"="1". I'm not sure exactly what effect this difference would have, but everything I have read on the subject has indicated that "AutoAdminLogon"="1" is the prefered setting.what does "embedded quotes without escaping them" mean? And how would it effect the way another cmd file works?He is referring to this line in your code:REG ADD %KEY%\030 /V 1 /D "%windir%\system32\cmd.exe /c rd /s /q """%systemdrive%\Install\""" /fIf I am reading this correctly, you are essentially trying to import a key that will open a command prompt and then execute the following command:rd /s /q "%systemdrive%\Install\"I can think of two possible solutions. The first, and far easier method, is to eliminate the registry entries from cleanup.cmd altogether. Unless there is some reason why you don't want the Install directory deleted until after the next reboot, you can input your rd command directly in cleanup.cmd and then reboot with the following as your complete cleanup.cmd file.RD /S /Q %systemdrive%\Installshutdown.exe -r -f -t 0You can enclose %systemdrive%\Install in quotes if you like, but it's not required. Same for the trailing backslash after Install.Edit: Please do not use this code (above), it will generate an error. See my post below for an explanation.If you really want to keep the Install directory until after the following reboot, or if you just want to know how it's done, try the following for your cleanup.cmd:SET KEY=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceExREG ADD %KEY%\030 /VE /D "Delete Work Directory" /fREG ADD %KEY%\030 /V 1 /D "%windir%\system32\cmd.exe /c rd /s /q %systemdrive%\Install" /fshutdown.exe -r -f -t 0This should import the rd command as it appears in the alternate cleanup.cmd I posted. The backslashes are needed before the quotation marks to indicate to the importing program that the quotes are a part of the string that is being imported, not the end of it. This is what Alanoll was talking about. Any quotes within a string that is itself quoted (embedded quotes) must be preceded by a backslash (escaped) to be imported properly. So, if you wanted to import the rd command with all quotes and the trailing backslash after Install, your line would look like this:REG ADD %KEY%\030 /V 1 /D "%windir%\system32\cmd.exe /c rd /s /q \"\"\"%systemdrive%\Install\\"\"" /fThat line is a direct copy of the one from your original code with a backslash added in front of every quote except for the first (after /D) and last (before /f) ones. It still looks to me like you have an excessive number of quotes there, but that may just be because I am unfamiliar with the /c switch for cmd.exe. Anyway, I hope this clears things up for you. I know when I first got started with this whole unattended thing, embedding quotes was confusing to me too. Edited December 12, 2004 by Cartoonite Link to comment Share on other sites More sharing options...
BBQmyNUTZ Posted December 11, 2004 Author Share Posted December 11, 2004 Deleting *after* reboot is just preferrable to me, and I think I pulled an error because an installed program was still using the directory when I tried to set the delete to occur on the first boot up.This:SET KEY=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceExREG ADD %KEY%\030 /VE /D "Delete Work Directory" /fREG ADD %KEY%\030 /V 1 /D "%windir%\system32\cmd.exe /c rd /s /q %systemdrive%\Install" /fshutdown.exe -r -f -t 0Worked perfectly, thanks for the explanation. You were right, I had an entra set of quotes in my original command, 2 in front of %systemdrive% would've been right. Still worked, though. ^_^Kai Link to comment Share on other sites More sharing options...
Cartoonite Posted December 12, 2004 Share Posted December 12, 2004 Glad to help. Deleting *after* reboot is just preferrable to me, and I think I pulled an error because an installed program was still using the directory when I tried to set the delete to occur on the first boot up.I suspect your error was the one that I just realized even the code I posted would generate. If cleanup.cmd exists in %systemdrive%\Install, which is where I believe most people, including myself, put it, the code I posted will delete the cmd file before it has a chance to execute the shutdown command. For that reason, the code in cleanup.cmd should be:shutdown.exe -r -f -t 60RD /S /Q %systemdrive%\InstallThis way the shutdown command is executed before the directory where our cmd file is located gets deleted. The 60-second delay allows enough time for the RD command to be processed before the pc reboots. My apologies if the errors in my previous code caused anyone any problems. I guess that's what I get for trying to script at 5 o'clock in the morning. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now