I already have autologon, so after FBA the user ncp_admin is logged on. The
script is started at phase 12999 of the FBA, without the FBA waiting for the
result. In the script I try to wait until after the automatic logon so that
it can apply my user specific settings.
The loop should report the 'SYSTEM' user when started, but after logon I
expected it to report 'ncp_admin' after which I would press 'Yes' to break
the loop and the script would apply the settings. The user interaction is
only there for test purposes, the final script should test for the proper
user and apply the settings.
The problem is as described: The value of 'oNetwork.UserName' doesn't change
from 'SYSTEM' to 'ncp_admin' after the logon. A new instance of the script,
started after the logon, the value of 'oNetwork.UserName' is 'ncp_admin' as
expected.
My conclusion is that the 'wscript.exe' takes some sort of snapshot when it
is started.
Currently, I have successfully applied the theme to default user registry
hive (HKEY_USERS\.DEFAULT) using this script:
======================================================================================
Sub cmiOnEndBuild(dwFlags)
Dim sKey
sKey = "HKEY_USERS\.DEFAULT\Control Panel\Colors"
oPL.TargetRegEdit cRegOpWrite, cRegCondAlways, cmiREG_EXPAND_SZ, sKey,
"", "mnmsrvc", cmiString
oPL.TargetRegEdit cRegOpWrite, cRegCondAlways, cmiREG_EXPAND_SZ, sKey,
"Active Title", "10 36 106", cmiString
oPL.TargetRegEdit cRegOpWrite, cRegCondAlways, cmiREG_EXPAND_SZ, sKey,
"ActiveBorder", "192 192 192", cmiString
oPL.TargetRegEdit cRegOpWrite, cRegCondAlways, cmiREG_EXPAND_SZ, sKey,
"ActiveTitle", "0 0 128", cmiString
oPL.TargetRegEdit cRegOpWrite, cRegCondAlways, cmiREG_EXPAND_SZ, sKey,
"AppWorkSpace", "128 128 128", cmiString
oPL.TargetRegEdit cRegOpWrite, cRegCondAlways, cmiREG_EXPAND_SZ, sKey,
"Background", "192 192 192", cmiString
oPL.TargetRegEdit cRegOpWrite, cRegCondAlways, cmiREG_EXPAND_SZ, sKey,
"ButtonAlternateFace", "192 192 192", cmiString
oPL.TargetRegEdit cRegOpWrite, cRegCondAlways, cmiREG_EXPAND_SZ, sKey,
"ButtonDkShadow", "0 0 0", cmiString
oPL.TargetRegEdit cRegOpWrite, cRegCondAlways, cmiREG_EXPAND_SZ, sKey,
"ButtonFace", "192 192 192", cmiString
oPL.TargetRegEdit cRegOpWrite, cRegCondAlways, cmiREG_EXPAND_SZ, sKey,
"ButtonHilight", "255 255 255", cmiString
oPL.TargetRegEdit cRegOpWrite, cRegCondAlways, cmiREG_EXPAND_SZ, sKey,
"ButtonLight", "192 192 192", cmiString
oPL.TargetRegEdit cRegOpWrite, cRegCondAlways, cmiREG_EXPAND_SZ, sKey,
"ButtonShadow", "128 128 128", cmiString
oPL.TargetRegEdit cRegOpWrite, cRegCondAlways, cmiREG_EXPAND_SZ, sKey,
"ButtonText", "0 0 0", cmiString
oPL.TargetRegEdit cRegOpWrite, cRegCondAlways, cmiREG_EXPAND_SZ, sKey,
"GradientActiveTitle", "16 132 208", cmiString
oPL.TargetRegEdit cRegOpWrite, cRegCondAlways, cmiREG_EXPAND_SZ, sKey,
"GradientInactiveTitle", "181 181 181", cmiString
oPL.TargetRegEdit cRegOpWrite, cRegCondAlways, cmiREG_EXPAND_SZ, sKey,
"GrayText", "128 128 128", cmiString
oPL.TargetRegEdit cRegOpWrite, cRegCondAlways, cmiREG_EXPAND_SZ, sKey,
"Hilight", "0 0 128", cmiString
oPL.TargetRegEdit cRegOpWrite, cRegCondAlways, cmiREG_EXPAND_SZ, sKey,
"HilightText", "255 255 255", cmiString
oPL.TargetRegEdit cRegOpWrite, cRegCondAlways, cmiREG_EXPAND_SZ, sKey,
"HotTrackingColor", "0 0 128", cmiString
oPL.TargetRegEdit cRegOpWrite, cRegCondAlways, cmiREG_EXPAND_SZ, sKey,
"InactiveBorder", "192 192 192", cmiString
oPL.TargetRegEdit cRegOpWrite, cRegCondAlways, cmiREG_EXPAND_SZ, sKey,
"InactiveTitle", "128 128 128", cmiString
oPL.TargetRegEdit cRegOpWrite, cRegCondAlways, cmiREG_EXPAND_SZ, sKey,
"InactiveTitleText", "192 192 192", cmiString
oPL.TargetRegEdit cRegOpWrite, cRegCondAlways, cmiREG_EXPAND_SZ, sKey,
"InfoText", "0 0 0", cmiString
oPL.TargetRegEdit cRegOpWrite, cRegCondAlways, cmiREG_EXPAND_SZ, sKey,
"InfoWindow", "255 255 225", cmiString
oPL.TargetRegEdit cRegOpWrite, cRegCondAlways, cmiREG_EXPAND_SZ, sKey,
"MenuHilight", "0 0 128", cmiString
oPL.TargetRegEdit cRegOpWrite, cRegCondAlways, cmiREG_EXPAND_SZ, sKey,
"MenuBar", "192 192 192", cmiString
oPL.TargetRegEdit cRegOpWrite, cRegCondAlways, cmiREG_EXPAND_SZ, sKey,
"MenuText", "0 0 0", cmiString
oPL.TargetRegEdit cRegOpWrite, cRegCondAlways, cmiREG_EXPAND_SZ, sKey,
"Menu", "192 192 192", cmiString
oPL.TargetRegEdit cRegOpWrite, cRegCondAlways, cmiREG_EXPAND_SZ, sKey,
"Scrollbar", "192 192 192", cmiString
oPL.TargetRegEdit cRegOpWrite, cRegCondAlways, cmiREG_EXPAND_SZ, sKey,
"TitleText", "255 255 255", cmiString
oPL.TargetRegEdit cRegOpWrite, cRegCondAlways, cmiREG_EXPAND_SZ, sKey,
"WindowFrame", "0 0 0", cmiString
oPL.TargetRegEdit cRegOpWrite, cRegCondAlways, cmiREG_EXPAND_SZ, sKey,
"Window", "255 255 255", cmiString
oPL.TargetRegEdit cRegOpWrite, cRegCondAlways, cmiREG_EXPAND_SZ, sKey,
"WindowText", "0 0 0", cmiString
sKey = "HKEY_USERS\.DEFAULT\Control Panel\Desktop"
oPL.TargetRegEdit cRegOpWrite, cRegCondAlways, cmiREG_EXPAND_SZ, sKey,
"", "mnmsrvc", cmiString
oPL.TargetRegEdit cRegOpWrite, cRegCondAlways, cmiREG_DWORD, sKey,
"ActiveWndTrkTimeout", 0, cmiInteger
oPL.TargetRegEdit cRegOpWrite, cRegCondAlways, cmiREG_EXPAND_SZ, sKey,
"AutoEndTasks", "0", cmiString
oPL.TargetRegEdit cRegOpWrite, cRegCondAlways, cmiREG_EXPAND_SZ, sKey,
"BlockSendInputResets", "", cmiString
oPL.TargetRegEdit cRegOpWrite, cRegCondAlways, cmiREG_DWORD, sKey,
"CaretWidth", 1, cmiInteger
oPL.TargetRegEdit cRegOpWrite, cRegCondAlways, cmiREG_EXPAND_SZ, sKey,
"CoolSwitch", "1", cmiString
oPL.TargetRegEdit cRegOpWrite, cRegCondAlways, cmiREG_EXPAND_SZ, sKey,
"CoolSwitchColumns", "7", cmiString
oPL.TargetRegEdit cRegOpWrite, cRegCondAlways, cmiREG_EXPAND_SZ, sKey,
"CoolSwitchRows", "3", cmiString
oPL.TargetRegEdit cRegOpWrite, cRegCondAlways, cmiREG_EXPAND_SZ, sKey,
"CursorBlinkRate", "530", cmiString
oPL.TargetRegEdit cRegOpWrite, cRegCondAlways, cmiREG_EXPAND_SZ, sKey,
"DragFullWindows", "1", cmiString
oPL.TargetRegEdit cRegOpWrite, cRegCondAlways, cmiREG_EXPAND_SZ, sKey,
"DragHeight", "4", cmiString
oPL.TargetRegEdit cRegOpWrite, cRegCondAlways, cmiREG_EXPAND_SZ, sKey,
"DragWidth", "4", cmiString
oPL.TargetRegEdit cRegOpWrite, cRegCondAlways, cmiREG_EXPAND_SZ, sKey,
"FontSmoothing", "2", cmiString
oPL.TargetRegEdit cRegOpWrite, cRegCondAlways, cmiREG_DWORD, sKey,
"FontSmoothingOrientation", 1, cmiInteger
oPL.TargetRegEdit cRegOpWrite, cRegCondAlways, cmiREG_DWORD, sKey,
"FontSmoothingType", 1, cmiInteger
oPL.TargetRegEdit cRegOpWrite, cRegCondAlways, cmiREG_DWORD, sKey,
"ForegroundFlashCount", 3, cmiInteger
oPL.TargetRegEdit cRegOpWrite, cRegCondAlways, cmiREG_DWORD, sKey,
"ForegroundLockTimeout", 200000, cmiInteger
oPL.TargetRegEdit cRegOpWrite, cRegCondAlways, cmiREG_EXPAND_SZ, sKey,
"GridGranularity", "0", cmiString
oPL.TargetRegEdit cRegOpWrite, cRegCondAlways, cmiREG_EXPAND_SZ, sKey,
"HungAppTimeout", "5000", cmiString
oPL.TargetRegEdit cRegOpWrite, cRegCondAlways, cmiREG_EXPAND_SZ, sKey,
"LowPowerActive", "0", cmiString
oPL.TargetRegEdit cRegOpWrite, cRegCondAlways, cmiREG_EXPAND_SZ, sKey,
"LowPowerTimeOut", "0", cmiString
oPL.TargetRegEdit cRegOpWrite, cRegCondAlways, cmiREG_EXPAND_SZ, sKey,
"MenuShowDelay", "400", cmiString
oPL.TargetRegEdit cRegOpWrite, cRegCondAlways, cmiREG_DWORD, sKey,
"PaintDesktopVersion", 0, cmiInteger
oPL.TargetRegEdit cRegOpWrite, cRegCondAlways, cmiREG_EXPAND_SZ, sKey,
"Pattern", "(None)", cmiString
oPL.TargetRegEdit cRegOpWrite, cRegCondAlways, cmiREG_EXPAND_SZ, sKey,
"PowerOffTimeOut", "0", cmiString
oPL.TargetRegEdit cRegOpWrite, cRegCondAlways, cmiREG_EXPAND_SZ, sKey,
"PowerOffActive", "0", cmiString
oPL.TargetRegEdit cRegOpWrite, cRegCondAlways, cmiREG_EXPAND_SZ, sKey,
"ScreenSaveActive", "1", cmiString
oPL.TargetRegEdit cRegOpWrite, cRegCondAlways, cmiREG_EXPAND_SZ, sKey,
"ScreenSaveTimeOut", "600", cmiString
oPL.TargetRegEdit cRegOpWrite, cRegCondAlways, cmiREG_EXPAND_SZ, sKey,
"SCRNSAVE.EXE", "C:\Windows\system32\ssmarque.scr", cmiString
oPL.TargetRegEdit cRegOpWrite, cRegCondAlways, cmiREG_EXPAND_SZ, sKey,
"TileWallpaper", "1", cmiString
oPL.TargetRegEdit cRegOpWrite, cRegCondAlways, cmiREG_BINARY, sKey,
"UserPreferencesMask", Str2Arr("9e,3e,04,80"), cmiBinary
oPL.TargetRegEdit cRegOpWrite, cRegCondAlways, cmiREG_EXPAND_SZ, sKey,
"WaitToKillAppTimeout", "20000", cmiString
oPL.TargetRegEdit cRegOpWrite, cRegCondAlways, cmiREG_EXPAND_SZ, sKey,
"Wallpaper", "", cmiString
oPL.TargetRegEdit cRegOpWrite, cRegCondAlways, cmiREG_EXPAND_SZ, sKey,
"WallpaperStyle", "0", cmiString
oPL.TargetRegEdit cRegOpWrite, cRegCondAlways, cmiREG_EXPAND_SZ, sKey,
"WheelScrollLines", "3", cmiString
sKey = "HKEY_USERS\.DEFAULT\Control Panel\Desktop\WindowMetrics"
oPL.TargetRegEdit cRegOpWrite, cRegCondAlways, cmiREG_EXPAND_SZ, sKey,
"", "mnmsrvc", cmiString
oPL.TargetRegEdit cRegOpWrite, cRegCondAlways, cmiREG_DWORD, sKey,
"AppliedDPI", 96, cmiInteger
oPL.TargetRegEdit cRegOpWrite, cRegCondAlways, cmiREG_DWORD, sKey,
"BorderWidth", -15, cmiInteger
oPL.TargetRegEdit cRegOpWrite, cRegCondAlways, cmiREG_BINARY, sKey,
"CaptionFont", Str2Arr( _
"f5,ff,ff,ff,00,00,00,00,00,00,00,00,00,00,00,00,bc,02,00,00," & _
"00,00,00,01,00,00,00,00,41,00,72,00,69,00,61,00,6c,00,00,00,00,00,00,00,00,"
& _
"00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,"
& _
"00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00"),
cmiBinary
oPL.TargetRegEdit cRegOpWrite, cRegCondAlways, cmiREG_EXPAND_SZ, sKey,
"CaptionHeight", "-270", cmiString
oPL.TargetRegEdit cRegOpWrite, cRegCondAlways, cmiREG_EXPAND_SZ, sKey,
"CaptionWidth", "-270", cmiString
oPL.TargetRegEdit cRegOpWrite, cRegCondAlways, cmiREG_BINARY, sKey,
"IconFont", Str2Arr( _
"f0,ff,ff,ff,00,00,00,00,00,00,00,00,00,00,00,00,90,01,00,00,00," & _
"00,00,01,00,00,00,00,41,00,72,00,69,00,61,00,6c,00,00,00,00,00,00,00,60,37,"
& _
"0c,00,00,00,00,00,0b,00,00,00,00,00,00,00,4c,00,00,00,4b,00,00,00,4b,00,00,"
& _
"00,01,00,00,00,f0,ff,ff,ff,00,00,00,00,00,00,00,00,00,00,00,00"),
cmiBinary
oPL.TargetRegEdit cRegOpWrite, cRegCondAlways, cmiREG_EXPAND_SZ, sKey,
"IconSpacing" ,"-1125", cmiString
oPL.TargetRegEdit cRegOpWrite, cRegCondAlways, cmiREG_EXPAND_SZ, sKey,
"IconTitleWrap", "1", cmiString
oPL.TargetRegEdit cRegOpWrite, cRegCondAlways, cmiREG_EXPAND_SZ, sKey,
"IconVerticalSpacing", "-1125", cmiString
oPL.TargetRegEdit cRegOpWrite, cRegCondAlways, cmiREG_BINARY, sKey,
"MenuFont", Str2Arr( _
"f0,ff,ff,ff,00,00,00,00,00,00,00,00,00,00,00,00,90,01,00,00,00," & _
"00,00,01,00,00,00,00,41,00,72,00,69,00,61,00,6c,00,00,00,00,00,00,00,00,00,"
& _
"00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,"
& _
"00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00"),
cmiBinary
oPL.TargetRegEdit cRegOpWrite, cRegCondAlways, cmiREG_EXPAND_SZ, sKey,
"MenuHeight", "-315", cmiString
oPL.TargetRegEdit cRegOpWrite, cRegCondAlways, cmiREG_EXPAND_SZ, sKey,
"MenuWidth", "-315", cmiString
oPL.TargetRegEdit cRegOpWrite, cRegCondAlways, cmiREG_BINARY, sKey,
"MessageFont", Str2Arr( _
"f0,ff,ff,ff,00,00,00,00,00,00,00,00,00,00,00,00,90,01,00,00," & _
"00,00,00,01,00,00,00,00,41,00,72,00,69,00,61,00,6c,00,00,00,00,00,00,00,00,"
& _
"00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,"
& _
"00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00"),
cmiBinary
oPL.TargetRegEdit cRegOpWrite, cRegCondAlways, cmiREG_EXPAND_SZ, sKey,
"MinAnimate", "1", cmiString
oPL.TargetRegEdit cRegOpWrite, cRegCondAlways, cmiREG_EXPAND_SZ, sKey,
"ScrollHeight", "-315", cmiString
oPL.TargetRegEdit cRegOpWrite, cRegCondAlways, cmiREG_EXPAND_SZ, sKey,
"ScrollWidth", "-315", cmiString
oPL.TargetRegEdit cRegOpWrite, cRegCondAlways, cmiREG_EXPAND_SZ, sKey,
"Shell Icon Size", "32", cmiString
oPL.TargetRegEdit cRegOpWrite, cRegCondAlways, cmiREG_BINARY, sKey,
"SmCaptionFont", Str2Arr( _
"f3,ff,ff,ff,00,00,00,00,00,00,00,00,00,00,00,00,bc,02,00," & _
"00,00,00,00,01,00,00,00,00,41,00,72,00,69,00,61,00,6c,00,00,00,00,00,00,00,"
& _
"00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,"
& _
"00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00"),
cmiBinary
oPL.TargetRegEdit cRegOpWrite, cRegCondAlways, cmiREG_EXPAND_SZ, sKey,
"SmCaptionHeight", "-270", cmiString
oPL.TargetRegEdit cRegOpWrite, cRegCondAlways, cmiREG_EXPAND_SZ, sKey,
"SmCaptionWidth", "-270", cmiString
oPL.TargetRegEdit cRegOpWrite, cRegCondAlways, cmiREG_BINARY, sKey,
"StatusFont", Str2Arr( _
"f3,ff,ff,ff,00,00,00,00,00,00,00,00,00,00,00,00,90,01,00,00," & _
"00,00,00,01,00,00,00,00,41,00,72,00,69,00,61,00,6c,00,00,00,00,00,00,00,00,"
& _
"00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,"
& _
"00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00"),
cmiBinary
sKey = "HKEY_USERS\.DEFAULT\Control Panel\Screen Saver.Marquee"
oPL.TargetRegEdit cRegOpWrite, cRegCondAlways, cmiREG_EXPAND_SZ, sKey,
"Arial", "Arial Black", cmiString
oPL.TargetRegEdit cRegOpWrite, cRegCondAlways, cmiREG_EXPAND_SZ, sKey,
"Attributes", "00011", cmiString
oPL.TargetRegEdit cRegOpWrite, cRegCondAlways, cmiREG_EXPAND_SZ, sKey,
"BackgroundColor", "192 192 192", cmiString
oPL.TargetRegEdit cRegOpWrite, cRegCondAlways, cmiREG_EXPAND_SZ, sKey,
"CharSet", "0", cmiString
oPL.TargetRegEdit cRegOpWrite, cRegCondAlways, cmiREG_EXPAND_SZ, sKey,
"Mode", "1", cmiString
oPL.TargetRegEdit cRegOpWrite, cRegCondAlways, cmiREG_EXPAND_SZ, sKey,
"Size", "72", cmiString
oPL.TargetRegEdit cRegOpWrite, cRegCondAlways, cmiREG_EXPAND_SZ, sKey,
"Speed", "1", cmiString
oPL.TargetRegEdit cRegOpWrite, cRegCondAlways, cmiREG_EXPAND_SZ, sKey,
"Text", "Fico", cmiString
oPL.TargetRegEdit cRegOpWrite, cRegCondAlways, cmiREG_EXPAND_SZ, sKey,
"TextColor", "255 0 0", cmiString
sKey =
"HKEY_USERS\.DEFAULT\Software\Microsoft\Windows\CurrentVersion\Themes\LastTheme"
oPL.TargetRegEdit cRegOpWrite, cRegCondAlways, cmiREG_EXPAND_SZ, sKey,
"DisplayName of Modified", "NCP MMI (FBA)", cmiString
End Sub
Function Str2Arr(sHex)
Dim bArray(), nIdx, sLocal
sLocal = sHex
iIdx = 0
While (Len(sLocal) >= 2)
ReDim Preserve bArray(nIdx)
bArray(nIdx) = CByte("&h" + Left(sLocal, 2))
sLocal = Mid(sLocal, 4)
nIdx = nIdx + 1
Wend
Str2Arr = bArray
End Function
======================================================================================
Regards Thijs