|
|
|||||||
Hi all, I'm trying to get a script to do a little install work for me on startup on some machines using the startup script in GPO's. I'm using the getfileversion and readvalue to see if certain apps need to be updated (slowly working at removing local admin privileges from workstations). when running in a start up script, these two functions don't seem to return any data. I use these functions in the logon script and they have been working successfully. The script returns that it's running as system (elevated privileges, I would assume) but can't look at file version or registry entries any ideas? thanks Allan Code: IF Open( 1 , "C:\starup.log" , 5 ) = 0 $x = WriteLine( 1 , "entering Startup script " + @TIME + @CRLF ) $x = writeline(1, "running as " + lcase(@userid) + " " + @TIME + @CRLF) ENDIF close(1) $ret = getfileversion("C:\Program Files\Adobe\Reader 9.0\Reader\AcroRd32.exe") $jret=readvalue("HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment","Java6FamilyVersion") IF Open( 1 , "C:\starup.log" , 5 ) = 0 $x = WriteLine( 1 , "Adobe Version: |" + $ret + "|" + @TIME + @CRLF ) $x = WriteLine( 1 , "Java Version: |" + $jret + "|" + @TIME + @CRLF ) ENDIF close(1) result: entering Startup script 13:27:51 running as system 13:27:51 Adobe Version: ||13:27:51 Java Version: ||13:27:51 |
||||||||
|
|
|||||||
Off hand, I don't see anything wrong code wise. I would recommend a couple of changes, but nothing that should be causing your issue. I'd assume it has something to do with the environment being used when the script runs. If you try to run this script manually after login, it works as expected? |
||||||||
|
|
|||||||
|
||||||||
|
|
|||||||
BTW - the info on 64-bit file paths is in the manual, but info on 64-bit registry paths is in the README.TXT file. Using Quote: $ret = getfileversion("C:\Program Files\Adobe\Reader 9.0\Reader\AcroRd32.exe") Adding the following after the function calls will help you identify what's happening when things don't work: Code: If @ERROR ; function returned an error If Not $Ret $Ret = @SERROR Else $E1 = @SERROR EndIf EndIf Code: If $E1 $x = WriteLine( 1 , "Adobe ERROR:" + $E1 + @CRLF ) EndIf There's an fMsg() UDF on my web site's Resources/Kix UDF Lib page that will output messages with timestamps, and also ignore messages unless $DEBUG (a global var) is set. You can optionally specify the debug level, so at level 1, only some messages print, when $DEBUG is 2, more messages print, etc. Setting $DEBUG=0 in your code turns off all debugging messages. Glenn |