Jump to content
Sign in to follow this  

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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By MiKa666
      Hi all,
      I'm developing a tool for exploratively testing another software. For that I wanna cover all the GUI functionality from that software and verify everything works as intended. But now I've a problem which I couldnt solve so far.
      One thing that software I'm testing does, is to load up either a single picture or a series of pictures. Depending on how much pictures got loaded, further actions will be proceeded...
      This loaded pictures are schon within a ToolbarWindow and they're clickable. What I need to know is, how much pictures are in this ToolbarWindow...
      Can anybody provide me a tip on how to achive this?
      Would be amazing!!
    • By meety
      wingettext function can get the text content of the IE browser page, but the text content of the page cannot be obtained in the chrome browser? What should I do?
    • By DirtyJohny
      Hi everyone.Need rewrite this function how in еxample.
      #RequireAdmin #NoTrayIcon Opt("MustDeclareVars",1) Func _a() Local $sls=ObjGet("winmgmts:{impersonationLevel=impersonate," _ &"authenticationLevel=Pkt}!\\"& _ @ComputerName&'\root\wmi'),$lss=$sls.ExecQuery _ ('SELECT * FROM WmiMonitorID'), _ $lll,$sll,$sss="",$lsl,$lls,$i,$z For $z In $lss $lsl=$z.UserFriendlyName For $i=0 To Ubound($lsl)-1 if ($lsl[$i]) Then $lll&=Chr($lsl[$i]) Next $lls=$z.SerialNumberID For $i=0 To Ubound($lls)-1 if ($lls[$i]) Then $sll&=Chr($lls[$i]) Next $sss&="Model"&@TAB&@TAB&": "&$lll&@CR&"Serial Number"&@TAB&": "&$sll&@CR&@CR $lll="" $sll="" Next MsgBox(262144,'Monitors '&$lss.Count,$sss&" "&@CR) $lss=Null $sls=Null EndFunc _a() Example:
      Func _InfoPC() Local $ObjService = ObjGet('winmgmts:{impersonationLevel = impersonate}!\\' & @ComputerName & '\root\cimv2') Local $ObjMB = $ObjService.ExecQuery('SELECT * FROM Win32_BaseBoard', 'WQL', 0x30) If IsObj($ObjService) Then For $objItemMB In $ObjMB $sInfo &= @TAB & 'Motherboard: ...... ' & $objItemMB.Product & @CRLF I'm beginner in this sphere and need  you all speak easy and simply because i'm Russian.Thanks)
    • By Deshanur
      Am trying to automate injecting credential on the login form for all kind of Web application for IE. I know how to identify the form name by viewing the source code and using the method - _IEFormGetObjByName($ie, $form_Name).
      I would like to know how to identify or get the form object for the web app where there is no form name tag for example below, for the is I have used - _IEFormGetCollection($ie, 0) to get the form object.
      My Question is does it work for all kind of application "_IEFormGetCollection($ie, 0)" how to identify Index value? is it always 0? is there any better solution?
      The final solution am looking for is find out form object, get the username, password field and inject credential and submit the form.
      How to find out index value? for the forms which does not have form name field.
      $login_form = _IEFormGetCollection($ie, 0) $email_field = _IEFormElementGetObjByName($login_form, $form_UserName) $pass_field = _IEFormElementGetObjByName($login_form, $form_password) $login_button = _IEFormElementGetObjByName($login_form, $form_submitbutton) _IEFormElementSetValue($email_field, $CmdLine[2]) _IEFormElementSetValue($pass_field, $CmdLine[3]) ControlSend($hwnd, "", "[CLASS:Internet Explorer_Server; INSTANCE:1]","{Enter}") OR This works fine if the form has form name. $login_form = _IEFormGetObjByName($ie, $form_Name) $email_field = _IEFormElementGetObjByName($login_form, $form_UserName) $pass_field = _IEFormElementGetObjByName($login_form, $form_password) $login_button = _IEFormElementGetObjByName($login_form, $form_submitbutton) _IEFormElementSetValue($email_field, $CmdLine[2]) _IEFormElementSetValue($pass_field, $CmdLine[3]) ControlSend($hwnd, "", "[CLASS:Internet Explorer_Server; INSTANCE:1]","{Enter}")
    • By JuanFelipe
      Hello guys!
      I have a problem with a script, in the past I made a program and it worked perfect, I recently used it again and it already stands still in one step, the problem is a Javascript event that changed but now I cannot execute it.
      <td colspan="2" align="center"><input type="button" id="Buscar" name="Buscar" value="Buscar" onclick="javascript:enviarForma(document.obtenercasosPersonaPorDocumento,'0');" class="boton"></td>  
      Previously I used this code and it worked, but now it does nothing
      $botonconsulta = _IEGetObjByName($oIE,"Buscar") _IEAction($botonconsulta, 'click') _IELoadWait($oIE)  
      Now I have tried the following codes but none works.
      ;==================== 1 _IEHeadInsertEventScript($oIE, "document", "onclick", "javascript:enviarForma(document.obtenercasosPersonaPorDocumento,'0');") ControlClick("SUPER CELAC", "", "[CLASS:Internet Explorer_Server; INSTANCE:1]") _IELoadWait($oIE) ;==================== 2 $forma = $oIE.document.obtenercasosPersonaPorDocumento $oIE.Navigate("JavaScript:enviarForma("&$forma&",""0"");") _IELoadWait($oIE) ;==================== 3 $boton = _IEGetObjById($oIE, "Buscar") $boton.document.parentwindow.execScript("enviarForma(document.obtenercasosPersonaPorDocumento,'0');", "javascript") I hope you can guide me, because I think the error is in the parameters that the javascript function receives but I don't know how to send it, here I leave the first part of the JavaScript function.
      function enviarForma(frm,tipoForma){ var bExisteDatoConsulta = false; var bError=true; var mensajeError=""; switch (tipoForma) { //--Forma documento case "0": if (validar_campo_no_vacio_no_print(frm.numeroDocumento)) { if (!isNum(frm.numeroDocumento.value)) { bError = false; mensajeError += "El número de documento debe ser un valor numérico\n"; } bExisteDatoConsulta = true; } else { mensajeError += "Debe digitar un número de documento\n"; } break;  Thanks!
  • Create New...