Topic: hi. my script has error in sysprep. any expert guy knows script?
------------------------
' CheckForIntel.vbs
' Checks if the processor is an Intel and re-enables the power managment driver if it is.
' Written by Ryan D - based off the WMI sample script by Guy Thomas http://computerperformance.co.uk/
'
' ===Version History===
' 1.0 - Initial release
' 1.1 - Changed the way that the script checks for Intel machines. Now it looks at the CPU type and looks
' to see if the string "GenuineIntel" is present.
' --------------------------------------------------------------'
option explicit
const HKEY_LOCAL_MACHINE = &H80000002
dim objWMIService, objItem, colItems, strComputer, compModel, strKeyPath, strValueName, strValue, oReg
strKeyPath = "SYSTEM\ControlSet001\Services\intelppm"
strValueName = "Start"
strValue = "1"
strComputer = "."
' WMI connection to Root CIM and get the computer type
set objWMIService = GetObject("winmgmts:\\" _
& strComputer & "\root\cimv2")
set colItems = objWMIService.ExecQuery(_
"Select Manufacturer from Win32_Processor")
'Loop through the results and store the type in compModel
for each objItem in colItems
compModel = objItem.Manufacturer
next
'Get a registry object
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\default:StdRegProv")
'Check the computer type. If the processor is an Intel, then re-enable the driver
if compModel = "GenuineIntel" then
oReg.SetDWORDValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,strValue
else
end if
wmic cpu get Manufacturer | findstr /i intel
if "%errorlevel%" == "0" (sc config intelppm start= system)
' Exit
WSCript.Quit
-----------------------------------------------------
ok
first, i ran a script to disable intelppm and it said "invalid key name". so the key isn't existed in my registry
echo Enabling image for AMD and Intel processors
reg add "HKLM\SYSTEM\ControlSet001\Services\intelppm" /v Start /t REG_DWORD /d 4 /f
so, the above command isn't working. So i worry about intelppm. then i run this before i sysprep it:
sc config intelppm start= disabled
This will disable intelppm.
Then i used above script and add these 2 lines:
wmic cpu get Manufacturer | findstr /i intel
if "%errorlevel%" == "0" (sc config intelppm start= system)
basically these 2 lines are doing the same. i add it because i use "sc config intelppm start= disabled"
so after i deploy the image and run the script, it said error in end of file.
i think those 2 lines cause errors. anyone know how to fix the 2 lines.
I found those 2 lines from other site and it is used to disable the intelppm.
The error message is "expected end of statement"
Please help me correct the last 2 lines. does it needs endif?
Last edited by roadorange (2010-12-21 16:33:28)