Briandr Posted March 1, 2016 Share Posted March 1, 2016 (edited) If @OSArch = "X64" and @OSVersion = "WIN_7" Then RunWait(@ComSpec & " /c " & 'net stop pcasvc', "", @SW_HIDE) FileChangeDir("%systemroot%\sysnative") $CheckScreenSaverVer = RegRead("HKLM\Software\LANDesk", "ScreenSaverVersion") If $CheckScreenSaverVer = "MySSv2" Then Exit If FileExists("my.scr") Then FileDelete("my.scr") FileCopy(@ScriptDir & "\my.scr", "%systemroot%\sysnative\my.scr", 1) FileChangeDir("%systemroot%\syswow64") If FileExists("my.scr") Then FileDelete("my.scr") FileCopy(@ScriptDir & "\my.scr", "%systemroot%\syswow64\my.scr", 1) DllCall("kernel32.dll", "int", "Wow64DisableWow64FsRedirection", "int", 1) RegWrite("HKLM" & "\Software\LANDesk", "ScreenSaverVersion", "REG_SZ", "MySSv2") RunWait(@ComSpec & " /c " & 'net start pcasvc', "", @SW_HIDE) Exit EndIf This is working except the DLL call to disable folder re-direction is not working and the entry is going to the wrong place in the registry. It is right before the RegWrite command. At the top of the script I have #RequireAdmin. While I think the RegRead is working I am not entirely sure about that. Any ideas as to why the disable re-direct is not working? Help and suggestions appreciated. Edited March 1, 2016 by Briandr Link to comment Share on other sites More sharing options...
Briandr Posted March 2, 2016 Author Share Posted March 2, 2016 (edited) I was able to get this fixed this line: RegWrite("HKLM64" & "\Software\LANDesk", "ScreenSaverVersion", "REG_SZ", "MySSv2") What I am after now is some basic logging from the the following line to a file: $CheckScreenSaverVer = RegRead("HKLM\Software\LANDesk", "ScreenSaverVersion") If $CheckScreenSaverVer = "MySSv2" Then Exit I want to log to specific location and I tried checking for the quickest and simplest way to log the result. Can anyone help here? Edited March 2, 2016 by Briandr Link to comment Share on other sites More sharing options...
rudi Posted March 22, 2016 Share Posted March 22, 2016 (edited) Hi. You could use a INI File on a network share to write such results to specific "result sections". $Ini="\\Server\ShareToWriteTo\Path\MyMonitor.ini" ; do your checking, set $Result to e.g. "okay", "outdated", "not installed", <version-number>, ... $aSections=IniReadSectionNames($Ini) $sect=$Result $key=@ComputerName $Value="some descriptive text, timestamp, ..." ; clear up old results for $i = 1 to $aSections[0] IniDelete($Ini,$sect,$key) Next ; write current result IniWrite($ini,$sect,$key,$Value) Regards, Rudi. Edited March 22, 2016 by rudi syntax relevant typo Earth is flat, pigs can fly, and Nuclear Power is SAFE! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now