Page 1 of 1 1
Topic Options
#119158 - 2004-05-06 10:19 PM How to detect Server
Zeron Offline
Fresh Scripter

Registered: 2003-02-02
Posts: 5
I want to do something conditionally only if the system the script being run on is NOT a server. How can I tell if I am running on a server or regular verion of windows?
Top
#119159 - 2004-05-06 11:02 PM Re: How to detect Server
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
See @ProductSuite in the manual annd/or the FAQ.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#119160 - 2004-05-06 11:07 PM Re: How to detect Server
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11634
Loc: Space
Lookup the following macros in the KiXtart manual
@ProductSuite
@ProductType

or you can even run code similar to this.

Code:
Break On
Dim $SO,$HKLMSCCS,$Server
$SO=SetOption('Explicit','On')
$SO=SetOption('NoVarsInStrings','On')
$SO=SetOption('WrapAtEOL','On')
 

$HKLMSCCS='HKLM\SYSTEM\CurrentControlSet'
$Server=ReadValue($HKLMSCCS+'\Control\ProductOptions', 'ProductType')

If $Server<>'WinNT'
'This is a Server. Quit or run code for server' ?
Else
'This is a Workstation. Quit or run code for Workstation' ?
EndIf


Top
#119161 - 2004-05-07 12:09 PM Re: How to detect Server
Pierre FREMION Offline
Getting the hang of it

Registered: 2000-01-11
Posts: 66
Loc: Paris, France, Europe, Sun3
Hello

I use this.
If InSTR(@PRODUCTTYPE,'Server') or InSTR(@PRODUCTTYPE,'Controller')
; stop execution
Exit
EndIf

Works fine !
_________________________
Comments always welcome. French native so I apologize for my (mis)use of English!

Top
#119162 - 2004-05-07 11:40 PM Re: How to detect Server
Zeron Offline
Fresh Scripter

Registered: 2003-02-02
Posts: 5
Thanks. I uppgraded to 4.22 and now this works great. (had really old version before)
Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
1 registered (Henriques) and 2516 anonymous users online.
Newest Members
fgarcia, Viginette, ManuvdWielNL, Sir_Barrington, batdk82
17889 Registered Users

Generated in 0.063 seconds in which 0.035 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org