Jump to content

Recommended Posts

Posted

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:

Posted (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 by this-is-me
Who else would I be?
Posted

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

Posted

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.

Posted

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
Posted

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

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
  • 10 years later...
Posted (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 by Allow2010
  • Moderators
Posted (edited)

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!

Posted

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

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
  • Recently Browsing   0 members

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