![]() ![]() :: tries the Windows Activation again if run again. :: If there were any errors in the Windows Activation process then we need to delete the flag file so this script Windows activation script completed run on %computername%.Įcho Windows activation script completed run on %computername%>%WindowsFlag% If %errorlevel% geq 1 goto DoneWindowsActivationĮcho Second run of '%windir%\System32\Slmgr.vbs' produced following error:>%ErrorLog%Įcho. :: If it doesn't find the word 'Error' then no error was recorded, move on to the 'DoneWindowsActivation' label :: If it doesn't find the word 'Error' then no error was recorded, move on to the second run of the VBSĮcho First run of '%windir%\System32\Slmgr.vbs' produced following error:>%ErrorLog%Ĭscript //nologo "%windir%\System32\Slmgr.vbs" /ato >%slmgrLog% :: If the FindStr command finds the word 'Error' then it returns an errorlevel code of 0 so we increment our Error Counter (eCount) :: Having sent the output from the VBS to the log file, we now check that log file for the word 'Error' ![]() *Įcho Windows Activation script '%windir%\System32\Slmgr.vbs' not found>%ErrorLog%Ĭscript //nologo "%windir%\System32\Slmgr.vbs" /ipk %WindowsKey% >%slmgrLog% * Windows Activation script not found! Skipping to Office Activation. If /i exist "%windir%\System32\Slmgr.vbs" goto RunWindowsActivationĮcho. If /i not exist %WindowsFlag% goto ActivateWindowsĮcho. Set ErrorLog=%AllUsersProfile%\ActivationErrorLog.log Set WindowsKey=XXXXX-XXXXX-XXXXX-XXXXX-XXXXX Set OfficeFlag=%AllUsersProfile%\OfficeActivated.flg Set WindowsFlag=%AllUsersProfile%\DoneWindowsActivation.flg Title %userdomain% Activating Windows and MS OfficeĮcho %userdomain% Windows and Office activation script There is no apostrophe in the plural of PC (or PST, or CPU, or HDD, or FDD, or photo, or breakfast.and so on) RE: Windows 7 and Office 2010 Activation JPJeffery (TechnicalUser) 5 Apr 12 off I'm waffling, it's late, I've had a couple of glasses of wine.I'll think on this more and try to come up with a more elegant solution. Loopback Processing is something I've heard of which might help here. So, I might try an OU called Activate, apply the GPO to run the startup scripts there then move the computer account to where it really belongs.but that's all getting a bit messy. I usually create the Computer Account directly to the intended OU prior to joining a PC to the domain. If you move all computer accounts to more sensible OU to which a GPO can apply instead of applying at the domain root then this will be easy. You can't apply a GPO directly to a container, only to OUs or to the root of the domain which would then apply to all other OUs and Containers. When a computer is added to the domain the account goes in to the Computers container (not the same as an OU). So, we want these scripts to run only once, although presumably if they work everytime a PC boots up there's not likely to be any harm done. ![]() Yeah, that is annoying, and we have to do the same thing so let's help each other to work this out (you've already done your part by educating me that these scripts even exist!) ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |