lyledg Posted January 14, 2005 Share Posted January 14, 2005 Guys Knowing that Autoit can detect the OSversion by using the macro @OSVersion, is there a way or functionalility being worked on to detect Citrix as a OS platform? Thanx Link to comment Share on other sites More sharing options...
this-is-me Posted January 14, 2005 Share Posted January 14, 2005 (edited) I know nothing about Citrix, so forgive me if I ask a dumb question, but have you verified that AutoIt even runs on Citrix? Edited January 14, 2005 by this-is-me Who else would I be? Link to comment Share on other sites More sharing options...
lyledg Posted January 14, 2005 Author Share Posted January 14, 2005 Yes, it does I have written a GUI logon script that has been running in our network environment now for months, and it has been tested on Citrix. At the moment, I look for an custom environment variable that is set at build time of the server, but seeing that Autoit can detect what OS it is running on, I was just curious to know if Citrix can and if at all will be included at some point? Cheers Link to comment Share on other sites More sharing options...
sugi Posted January 14, 2005 Share Posted January 14, 2005 I guess you mean AutoIt runs within a Citrix session, not within a Citrix OS. This means that autoit runs on a windows server somewhere and reports the OS version of the windows server.I think the best you can do is check if there are special environment variables that are only set when a Citrix session is active or maybe registry entries. Link to comment Share on other sites More sharing options...
HighGuy Posted January 14, 2005 Share Posted January 14, 2005 I once wrote a function detecting if my script is running on a Terminal Server. Maybe it suits your need. Func IsTerminalServer() Local $ProductSuite $ProductSuite = RegRead ( 'HKEY_LOCAL_MACHINE\' & 'system\currentcontrolset\control\ProductOptions', 'ProductSuite' ) if @error then Return 0 SetError(1) Else Select Case $ProductSuite[1] = "Terminal Server" Return 1 Case Else Return 0 SetError(1) EndSelect EndIf EndFunc Link to comment Share on other sites More sharing options...
lyledg Posted January 14, 2005 Author Share Posted January 14, 2005 Thanks HighGuy, that is EXACTLY what I was needing... Cheers mate Link to comment Share on other sites More sharing options...
jpm Posted January 14, 2005 Share Posted January 14, 2005 I once wrote a function detecting if my script is running on a Terminal Server. Maybe it suits your need.Func IsTerminalServer() Local $ProductSuite $ProductSuite = RegRead ( 'HKEY_LOCAL_MACHINE\' & 'system\currentcontrolset\control\ProductOptions', 'ProductSuite' ) if @error then Return 0 SetError(1) Else Select Case $ProductSuite[1] = "Terminal Server" Return 1 Case Else Return 0 SetError(1) EndSelect EndIf EndFunc<{POST_SNAPBACK}>not running under XP SP2 faile on $ProductSuite[1] Link to comment Share on other sites More sharing options...
HighGuy Posted January 17, 2005 Share Posted January 17, 2005 not running under XP SP2 faile on $ProductSuite[1] <{POST_SNAPBACK}>Not sure if the return value for RegRead() changes in one of the last betas when processing a REG_MULTI_SZ key. So here is a corrected version:Func _IsTerminalServer() Local $sProductSuite $sProductSuite = RegRead ( "HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\ProductOptions", "ProductSuite" ) if @error then Return 0 SetError(1) Else Select Case StringInStr($sProductSuite, "Terminal Server") Return 1 Case Else Return 0 SetError(1) EndSelect EndIf EndFunc ;==>_IsTerminalServer Link to comment Share on other sites More sharing options...
Allow2010 Posted October 23, 2015 Share Posted October 23, 2015 (edited) the function from the previous posts does not work for me, my version uses getsystemmetrics and this seems to work fine...#include <WinAPI.au3> Func _IsTerminalserver() Return _WinAPI_GetSystemMetrics(4096) EndFunc ;==>_IsTerminalserver Edited October 23, 2015 by Allow2010 Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted October 23, 2015 Moderators Share Posted October 23, 2015 (edited) the function from the previous posts does not work for mePerhaps because it is 10 years old. AutoIt has changed just a bit as a language in that time. In the future, please do not resurrect old posts like this. Edited October 23, 2015 by JLogan3o13 "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
Allow2010 Posted October 23, 2015 Share Posted October 23, 2015 I am sorry, but as searching for _IsTerminalServer() brought me here i thought i add a working solution for everyone who comes here like me...in future i will try to keep in mind not to answer in very old threads.. 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