First off… populate HKEY_LOCAL_MACHINE\SOFTWARE\snowland\PXEFilter\ with some strings (ProviderServer, SiteCode, Username, Password, Collection).
Second, edit the pxefilter.vbs and change the following lines:
sProviderServer = ""
sSiteCode = "ABC"
sNamespace = "root\sms\site_" & sSiteCode
sUsername = ""
sPassword = ""
sCollection = "ABC00004" 'This must be a collection ID, not a collection name
To this new code:
Function readRegistry(sRegKey, sDefaultValue)
Dim oWshShell, sVal
Set oWshShell = CreateObject("WScript.Shell")
On Error Resume Next
sVal = oWshShell.RegRead(sRegKey)
If Err.Number <> 0 Then
readRegistry = sDefaultValue
Else
readRegistry = sVal
End If
On Error Goto 0
Set oWshShell = Nothing
End Function
Const cKeyPath = "HKEY_LOCAL_MACHINE\SOFTWARE\snowland\PXEFilter\"
sProviderServer = readRegistry(cKeyPath & "ProviderServer", "")
sSiteCode = readRegistry(cKeyPath & "SiteCode", "ABC")
sUsername = readRegistry(cKeyPath & "Username", "")
sPassword = readRegistry(cKeyPath & "Password", "")
sCollection = readRegistry(cKeyPath & "Collection", "ABC00004")
sNamespace = "root\sms\site_" & sSiteCode
Now, on startup the filter will read from HKLM to get the settings, if there is an error when reading (no value, no rights) the script will default to “ABC” for sSiteCode and so on…