|
|
|||||||
We have a mix of XP, Windows 7 and Citrix. I'm trying to capture what the OS is so we can run specific things against desktop OS and server OS for Citrix . I thought I had this little bit of code working, but after working with it some more turns out I don't and I'm not seeing where I went wrong. On Server 2008 it still runs the commands that I want to run against XP or Windows 7. The @ProductType does return Windows Serve 2008 R2 when ran. Code: Select Case @PRODUCTTYPE = "Windows XP Professional" Or "Windows XP Professional Tablet PC" Or "Windows 7 Professional Edition" Stuff For PCs Only Case @PRODUCTTYPE = "Windows Server 2003" Or "Windows Server 2003 R2" Or "Windows Server 2008" Or "Windows Server 2008 (R2)" Stuff for Servers Only EndSelect Hopefully this is dumb and someone can point it out. Feel free to make fun of me freely |
||||||||
|
|
|||||||
You're funny looking! |
||||||||
|
|
|||||||
Oh - you probably want an answer, too.. This is what I use in my KInstall utility: Code: ; ====================================================================== ; IDENTIFICATION OF O/S ; determine the O/S installed & announce the findings.. ; $OSver= @DOS ; O/S Version $fWS = 0 If Not InStr(@PRODUCTTYPE, 'Server') Or InStr(@PRODUCTTYPE, 'Controller') $fWS = 1 ; set the Workstation flag EndIf $ = Split(@PRODUCTTYPE, ' ') ; accommodate old versions of Kix that called 2008 "Longhorn" If InStr($[2], 'Longhorn') $[1] = '2008' EndIf $SYSID = IIf($[1] = 'Server', 'WIN' + $[2], 'WIN' + $[1]) ; show data 'PType: ' @PRODUCTTYPE ? 'OSVer: ' $OSver ? 'SysID: ' $SysID ? ' WS: ' $fWS ? Glenn |
||||||||
|
|
|||||||
Glen. You are a gentleman among gentlemen! So then you've found the OS, then your use your variables are you using an IF or Select/Case to do the rest of your work? |
||||||||
|
|
|||||||
Nevermind. After getting caffeinated I'm good |
||||||||
|
|
|||||||
Yeah - for clarity of the post, though, I basically run through a Select/Case process on this. Code: Select Case $SysID = 'Win2000' If $fWS ; workstation stuff.. Else ; server stuff.. EndIf Case $SysID = 'WinXP' ; XP stuff Case $SysID = 'Win2003' Server 2003 stuff.. ; and so on... EndSelect Glenn |
||||||||
|
|
|||||||
Even Simpler Yet: Code: Select Case $fWS = 1 ? "Running TrackIT Machine Audit" run "\\IT-MGMT\TRACKIT\Audit.exe" call "@scriptdir\PCPrinters.kix" Case #fWS = 0 ; Nothing to See Here Move On ;call CitrixPrinters.kix EndSelect |