#174380 - 2007-03-01 10:02 PM
Check Windows Operating System Version
|
endodave
Starting to like KiXtart
Registered: 2005-08-17
Posts: 101
|
I'm trying to push the Time Zone Update via a Group Policy, but I only want to run it against those machines that are Windows XP. Is there a way to check for specific OS version in kixtart? I know there is a generic Win NT check, but I need something more granular so the update doesn't get pushed to W2K clients. Also, is there a way to make it so that once the update is applied, it is not applied again after subsequent reboots? In other words, the script first checks to see if it has been applied? I guess one way to do it would be to copy the update file to the local hard drive and then run it from that. Then kixtart could check to see if the file exists on the drive. If it does, exit. Would that work? Is there a better way? Can someone help with the scripting for that? I am not an expert so I sure appreciate any assistance you can provide. Thanks.
Edited by endodave (2007-03-01 10:05 PM)
|
|
Top
|
|
|
|
#174382 - 2007-03-01 11:10 PM
Re: Check Windows Operating System Version
[Re: Glenn Barnas]
|
endodave
Starting to like KiXtart
Registered: 2005-08-17
Posts: 101
|
Cool! i have since found that there is a TZI binary key in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Pacific Standard Time that holds the time information and whether or not the update has been applied. is there a way i can read that, compare it to a string and if there is a match, skip. if not, launch the update executable? i'm a little confused how i use readvalue to assign to a variable and then compare that to a string. i'm not sure how kixtart is going to read the value.
|
|
Top
|
|
|
|
#174383 - 2007-03-01 11:32 PM
Re: Check Windows Operating System Version
[Re: endodave]
|
endodave
Starting to like KiXtart
Registered: 2005-08-17
Posts: 101
|
here's what i have so far. unfortunately, the script is calling the executable at start up every time, so something isn't working:
$TZCUR = ReadValue("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Pacific Standard Time", "TZI")
$rc = Open (1, "\\server\kixtart_log\TZ_RegKey.csv", 5) $rc = writeline (1, @TIME + "," + @DATE + "," + @WKSTA + "," + @USERID + "," + @fullname + "," + $TZCUR + @CRLF) $rc = Close (1)
$TZNEW = "e001000000000000c4ffffff00000b0000000100020000000000000000000300000002000200000000000000"
if @DOS=5.1 goto install endif
:install
if $TZCUR <> TZNEW shell "\\server\netlogon\XPTZupd.exe" ENDIF
exit
exit
Edited by endodave (2007-03-01 11:41 PM)
|
|
Top
|
|
|
|
#174384 - 2007-03-01 11:48 PM
Re: Check Windows Operating System Version
[Re: endodave]
|
Witto
MM club member
   
Registered: 2004-09-29
Posts: 1828
Loc: Belgium
|
If NOT @LOGONMODE
Break On
Else
Break Off
EndIf
Dim $RC
$RC = SetOption("Explicit", "On")
$RC = SetOption("NoMacrosInStrings", "On")
$RC = SetOption("NoVarsInStrings", "On")
$RC = SetOption("WrapAtEOL", "On")
Dim $Entry, $Value
$Value = "YouKnowWhatValueItShouldBe"
; Is this the value?
; $Value = "e001000000000000c4ffffff00000b0000000100020000000000000000000300000002000200000000000000"
$Entry = ReadValue("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Pacific Standard Time","TZI")
If NOT $Value = $Entry AND @DOS = "5.1"
;Do stuff, install update
EndIf
|
|
Top
|
|
|
|
#174387 - 2007-03-02 12:06 AM
Re: Check Windows Operating System Version
[Re: Witto]
|
endodave
Starting to like KiXtart
Registered: 2005-08-17
Posts: 101
|
well, i think we're getting close. the update is not installing at all now. so, it must think the value = entry.
nevermind - my goof. i'll get back to you....
Edited by endodave (2007-03-02 12:07 AM)
|
|
Top
|
|
|
|
#174389 - 2007-03-02 12:26 AM
Re: Check Windows Operating System Version
[Re: Witto]
|
endodave
Starting to like KiXtart
Registered: 2005-08-17
Posts: 101
|
it was my goof. had the wrong server name for install. you are a genius! now i am going to try to write one for the outlook update to run after this one. thanks again! i'll write back if i need help.
|
|
Top
|
|
|
|
#174392 - 2007-03-02 01:35 AM
Re: Check Windows Operating System Version
[Re: Witto]
|
endodave
Starting to like KiXtart
Registered: 2005-08-17
Posts: 101
|
pretty simple. since the outlook update requires the windows update, i just changed the line to If $Value = $Entry AND @DOS = "5.1" for that portion and viola! thanks again.
|
|
Top
|
|
|
|
#174564 - 2007-03-07 05:29 PM
Re: Check Windows Operating System Version
[Re: Witto]
|
endodave
Starting to like KiXtart
Registered: 2005-08-17
Posts: 101
|
oops, need to know now how to tell if the OS is W2K SP4. from your previous post, @DOS = "5.1" is for XP SP2. Looking forward to your response. thanks!
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 2220 anonymous users online.
|
|
|