Answers:
只需将这批文件放在您的sysprep脚本中,即可为您解决问题。在32位和64位系统以及不同的OS上进行了测试。
也许有人可以vbs这个或任何东西。
activateproper.cmd
REM CUSTOMER NAME HERE
REM DATE LAST MODIFIED
set _win7vlk=XXXXX-8FFQX-YYYYY-33XHT-ZZZZZ
set _2010vlk=YYYYY-YYYYY-WQGB6-KW8P8-XXXXX
REM Use current working dir
cd /d "%~dp0"
if not defined _win7vlk if not defined _2010vlk goto :nokey
echo Checking for internet connectivity needed to activate
echo This screen will not progress until internet is established
echo If you are using firewall please disable the firewall temporarily
:LOOP
PING -n 3 google.com|find "TTL" >NUL
IF NOT ERRORLEVEL 1 goto :ENDLOOP
IF ERRORLEVEL 1 goto :LOOP
:ENDLOOP
echo Internet Detected
echo Change the time
net time \\LANMACHINEWITHCORRECTTIME /set /y
echo Prompt to activate Windows 7 if needed
if exist "%windir%\system32\slmgr.vbs" FOR /F "tokens=5" %%a in ('cscript "%windir%\system32\slmgr.vbs" -xpr') do (set _act=%%a)
if "%_act%" neq "activated." if defined _win7vlk (
cscript "%windir%\system32\slmgr.vbs" -ipk %_win7vlk%
cscript "%windir%\system32\slmgr.vbs" -ato
)
echo Prompt to activate Office 2010 if needed
if exist "%PROGRAMFILES%\Microsoft Office\Office14\WINWORD.exe" set _offver=%PROGRAMFILES%
if exist "%PROGRAMFILES% (x86)\Microsoft Office\Office14\WINWORD.exe" set _offver=%PROGRAMFILES% (x86)
if defined _offver if defined _2010vlk (FOR /F "tokens=3* delims=: " %%a in ('cscript "%_offver%\Microsoft Office\Office14\OSPP.VBS" /dstatus') do (
if "%%a" == "---OOB_GRACE---" (cscript "%_offver%\Microsoft Office\Office14\OSPP.VBS" /inpkey:%_2010vlk%
cscript "%_offver%\Microsoft Office\Office14\OSPP.VBS" /act)
if "%%a" == "---OOT_GRACE---" (cscript "%_offver%\Microsoft Office\Office14\OSPP.VBS" /inpkey:%_2010vlk%
cscript "%_offver%\Microsoft Office\Office14\OSPP.VBS" /act)
if "%%a" == "---NOTIFICATIONS---" (cscript "%_offver%\Microsoft Office\Office14\OSPP.VBS" /inpkey:%_2010vlk%
cscript "%_offver%\Microsoft Office\Office14\OSPP.VBS" /act)
))
:nokey