strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colOperatingSystems = objWMIService.ExecQuery _
("Select * from Win32_OperatingSystem")
For Each objOperatingSystem in colOperatingSystems
'Wscript.Echo objOperatingSystem.Caption
'Wscript.Echo objOperatingSystem.Version
'WScript.Echo Mid(objOperatingSystem.Caption,19,4)
If InStr(objOperatingSystem.Caption,"Windows 2000") Then
'WScript.Echo objOperatingSystem.Caption & " " & objOperatingSystem.Version
Const HKEY_CLASSES_ROOT = &H80000000
Const HKEY_CURRENT_USER = &H80000001
Const HKEY_LOCAL_MACHINE = &H80000002
const HKEY_USERS = &H80000003
Const HKEY_CURRENT_CONFIG = &H80000005
Set objReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & _
strComputer & "\root\default:StdRegProv")
strKeyPath1 = "Software\Policies\Microsoft\Windows NT\Printers\Wizard\"
strEntryName1 = "Default Search Scope"
strEntryName2 = "Printers Page URL"
strEntryName3 = "Downlevel Browse"
strStringValue1 = "LDAP://DC=windows,DC=microsoft,DC=com"
strStringValue2 = "\\\\PrintServerName"
strDWORDValue1 = "1"
objReg.SetStringValue HKEY_CURRENT_USER,strKeyPath1,strEntryName1,strStringValue1
objReg.SetStringValue HKEY_CURRENT_USER,strKeyPath1,strEntryName2,strStringValue2
objReg.SetDWORDValue HKEY_CURRENT_USER,strKeyPath1,strEntryName3,strDWORDValue1
' objReg.DeleteKey HKEY_CURRENT_USER, strKeyPath1
' objReg.DeleteValue HKEY_CURRENT_USER,strKeyPath1,strStringValueName1
' objReg.DeleteValue HKEY_CURRENT_USER,strKeyPath1,strStringValueName2
' objReg.DeleteValue HKEY_CURRENT_USER,strKeyPath1,strDWORDValueName1
strKeyPath2 = "SOFTWARE\Policies\Microsoft\Windows NT\Printers\"
strEntryName3 = "SupportLink"
strEntryName4 = "SupportLinkName"
strStringValue3 = "\\\\PrintServerName"
strStringValue4 = "Print Server : PrintServerName"
objReg.SetStringValue HKEY_LOCAL_MACHINE,strKeyPath2,strEntryName3,strStringValue3
objReg.SetStringValue HKEY_LOCAL_MACHINE,strKeyPath2,strEntryName4,strStringValue4
' objReg.DeleteKey HKEY_LOCAL_MACHINE, strKeyPath2
' objReg.DeleteValue HKEY_LOCAL_MACHINE,strKeyPath2,strStringValueName3
' objReg.DeleteValue HKEY_LOCAL_MACHINE,strKeyPath2,strStringValueName4
End If
Next
Bookmark this post:
|
0 评论:
发表评论