Jump to content

Citrix and Autoit?


lyledg
 Share

Recommended Posts

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

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

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

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:
Link to comment
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
Link to comment
Share on other sites

  • 10 years later...
  • Moderators

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!

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...