Jump to content

How to navigate fron Xen Desktop to our Local System

Recommended Posts

I tried (using AutoIt) to automate a scenario where i  have to open IE with specific URL on my extranet(Xen Desktop or Citrix ) ,from there i need to download  file and then through WinSCP; I  have to move that file to another location that can be access from my Local system using VMWare.

I did as far as the above step. Now i want to navigate from my extranet to my local desktop system. But i am not able to move  from there.Mouse click is also not working.Please find the below screenshot highlighted in YELLOW.




Share this post

Link to post
Share on other sites

I'm assuming you are running your script from inside the citrix desktop?  if so, that drop down and home are not visible to the client itself.  you would have to have the autoIT script running on your local system to click those.

I have a few scripts that run between Citrix and local systems and I use an .ini file on a network share that is updated when the Citrix desktop script is finished so the local system script knows when to take over.


hmm... I guess I have to have a signature...

Share this post

Link to post
Share on other sites

My Citrix scripts are rather complicated and use too much internal Company stuff to share but here is a quick overview.

Main app is run from local desktop
  Create/update an ini file on a network share to flip a flag to say it needs to run, and identify what to run.
  Launch a specific Published Desktop where I have login scripts enabled, 2 ways to do this.
    1.  Use _IECreate to access your Citrix site then _IE.. stuff to login, and click the one you want
    2.  Use registry to find the one you want and launch via command line.
  Loop, checking every xxx seconds until the .ini flag switches to finished.

Citrix desktop Startup Script  this was the hardest for me to get as it required some admin config to allow
  Read the .ini file on the network share
    if the flag is not set, then exit as this was started for a different reason.
    if the flag IS set then launch the app identfied in the .ini "this way I can use this 1 launcher for many other things"

The actual script
  Perform the actions you want, get any script specific settings needed from the .ini
  once finished, mark the the .ini as finished

Main App picks up again
  You can now, gather log files, or whatever else you need to do, like close or minimize Citrix.



Here is some code on how to launch a Citrix item.  Not sure if it will work in your environment as it was rather complicated to figure out.

#include <File.au3> ;Needed for the _PathSplit

;Get the Citrix MachineID
    $sMachineID = RegRead("HKEY_CURRENT_USER\Software\Citrix\Dazzle", "CurrentAccount")         ;CompanyID-123456  This is the pointer needed for other steps
    If @error Then
        MsgBox(0, "Citrix", "Unable to identify this machine Citrix ID")

    $sAppID = "@@DesktopName v1 $MoreStuff"                                                     ;This is the @@ Name for the item we want which will be appended to the $sMachineID
    $sCitrixRegPath = "Software\Microsoft\Windows\CurrentVersion\Uninstall\"                    ;Each Citrix item will be in a sub folder \$sMachineID & $sAppID

;Piece stuff together to get the Launch string for the item we want to start
    $sLaunchString = RegRead("HKCU\" & $sCitrixRegPath & $sMachineID & $sAppID, "LaunchString") ;Get the full string to pass to the .exe to launch
    $sCitrixApp = RegRead("HKCU\" & $sCitrixRegPath & $sMachineID & $sAppID, "ShortcutTarget")  ;Get the location of the SelfService.exe that launches Citrix

;Split out the full path to the SelfService.exe to use as the Working Directory
    Local $sDrive, $sDir, $sFile, $sExt
    $aPath = _PathSplit($sCitrixApp, $sDrive, $sDir, $sFile, $sExt)
    $sCitrixDir = $aPath[1] & StringLeft($aPath[2], StringLen($aPath[2]) - 1)

;Launch the SelfService.exe with the command line options, and the working path, This will spawn a seperate item once fully loaded.
;Using ShellExecuteWait as once it's fully loaded, the initial process closes.
    $iPID = ShellExecuteWait($sCitrixApp, $sLaunchString, $sCitrixDir)
    ConsoleWrite("Launched the Citrix item" & @CRLF)


hmm... I guess I have to have a signature...

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

  • Similar Content

    • By nooneclose
      Good morning, I am trying to figure out if it is possible to check if these invoice lines exist or not. 
      Here are the table and column name: INVOICELINE.INVOICELINENUM (a required field if created)
      Here is a picture of what I am talking about. (Do not worry about security. the picture is from a demo test site so all information is fake)
      is there any way to check if these fields exist or not? (they do not exist unless the user clicks on "New Row")
      Example: line 11 does not exist right now. How would I go about to see if it did or not? 
      This is what I have so far:
      SELECT DISTINCT iv.invoicenum, iv.description FROM invoice AS iv JOIN invoiceline AS ivl ON iv.invoicenum = ivl.invoicenum AND iv.siteid = ivl.siteid /* = 'nothing' and yet somehow not null? */ WHERE iv.invoicenum NOT IN (SELECT invoicelinenum FROM invoiceline WHERE invoicelinenum IS NOT NULL) I get 0 results where I should get more than 0. 
    • By Kruxe
      Hello Everyone,
      I am very green when it comes to AutoIT, I have recently started using it to automate a job that i perform using MS Excel and that is working great. Recently I have been faced with a challenge I which i need to copy a specific set of lines from one .txt file and past them, overwriting a specific set of lines in a different .txt file. I honestly have no clue how I can copy the specified lines and transfer them. What functions / commands could I use and how could I lay them out I AutoIT? Any and all help will be appreciated. 
    • By Saravanan2213
      Hi everyone,
      i just need your help. i have script for cleaning browsing history and other unwanted file but the problem is i don't want to see the GUI i have attached below. It should not show anything on the screen. is it possible to do it in autoit. thanks in advance.
      So for i have tried flag
      Run("rundll32.exe InetCpl.cpl,ClearMyTracksByProcess 255", "", @SW_HIDE)
      Looking forward your help.........

    • By cptHark
      Hello I want to conect to a Network with DriveMapAdd.
      This worked just fine but when you restart the Computer the Mapped drive is gone.
      So i used the persistent mapping flag and that seemed to work, too.
      However when the Computer is restarted I cant connect to the Network because it doesnt remember the Username and password I ave it the first time.
      How do I fix this?
      My Code:Func
          DriveMapAdd("M:", GUICtrlRead($driveM),1, GUICtrlRead($netzuser),GUICtrlRead($netzpassword) )
      $netzuser and $netzpassword are set earlier in the gui and it works right after executing the script but i want it to stay connected
    • By nooneclose
      Morning, I am wondering is there is a way to prevent a script from ending/crashing when a "Subscript used on non-accessible variable" error occurs? 
      Here is some of my code:
      $aItems = _OL_ItemFind($oOutlook, $mFolder[1], $olMail, "[UnRead]=True", "Subject", "Maintenance Request", "EntryID,Subject", "", 0) If @error Then Sleep(2000) LoopUnreadEmails() ;Exit MsgBox(48, "", "@error = " & @error & ", @extended: " & @extended & " at line: " & @ScriptLineNumber) EndIf Error Msg:
      (371) : ==> Subscript used on non-accessible variable.: $aItems = _OL_ItemFind($oOutlook, $mFolder[1], $olMail, "[UnRead]=True", "Subject", "Maintenance Request", "EntryID,Subject", "", 0) $aItems = _OL_ItemFind($oOutlook, $mFolder^ ERROR I know that error occurs very rarely and at random. But like with most errors "in this case" I can use recursion to fix it. 
      I just recall the function and it will and has fixed itself. But this "Subscript used on non-accessible variable" just ends the script.
      Like I said before, is there a way to allow the script to keep running or call a function when this error occurs instead of just ending?   
  • Create New...