Jump to content
Sign in to follow this  
lyledg

Citrix and Autoit?

Recommended Posts

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 :idiot:

Share this post


Link to post
Share on other sites

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 by this-is-me

Who else would I be?

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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] :idiot:

Share this post


Link to post
Share on other sites

not running under XP SP2 faile on $ProductSuite[1] :idiot:

<{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

Share this post


Link to post
Share on other sites

the function from the previous posts does not work for me

Perhaps 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 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!

Share this post


Link to post
Share on other sites

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..
 

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...