AutoIT ActiveX

Author Message
DiGiTAL.SkReAM

  • Total Posts : 1259
  • Scores: 7
  • Reward points : 0
  • Joined: 9/7/2005
  • Location: Clearwater, FL, USA
  • Status: offline
AutoIT ActiveX Wednesday, April 16, 2008 7:57 AM (permalink)
0
Anyone familiar with autoit?
I have been working to use vbscript and AutoItX to send keystrokes to a guest OS in vmware, but am having some difficulty.
Here is my code:
 Set oAutoIt = CreateObject("AutoItX3.Control")
 oAutoIt.ControlFocus "Local host - VMware Server Console","",""
 WScript.Sleep 1000
 oAutoIt.ControlSend "Local host - VMware Server Console","","","!m"
 WScript.Sleep 500
 oAutoIt.ControlSend "Local host - VMware Server Console","","","g" 'This grabs the input
 WScript.Sleep 500
 wscript.Echo oAutoIt.ControlSend("Local host - VMware Server Console","","VMWare.GuestWindow1","password")
 WScript.Sleep 500
 wscript.Echo oAutoIt.ControlSend ("Local host - VMware Server Console","","VMWare.GuestWindow1","{ENTER}")
 

 
I am able to change focus to the main vmware window, etc.  But, nothing ever gets entered into the guest OS.
I know that it can be done, but since I have to be able to use the Control-series of commands since the workstationw ill be locked during this operation, I can't use
anything like SendKeys.
What am I doing wrong?
"Would you like to touch my monkey?" - Dieter (Mike Meyers)

"It is better to die like a tiger, than to live like a pussy."
-Master Wong, from Balls of Fury
 
#1
    daluu

    • Total Posts : 53
    • Scores: 0
    • Reward points : 0
    • Joined: 4/17/2006
    • Status: offline
    RE: AutoIT ActiveX Friday, April 18, 2008 12:44 PM (permalink)
    0
    Are you trying to automate the guest OS in VMWare with AutoIt from the host OS running VMWare? If so, I don't know if that's feasible. AutoIt on the host OS can't detect GUI controls within the guest OS. You're better off running AutoIt on the guest natively.

    You could also try doing an automated "mouse click" within the guest OS window area of the VMWare console to make that active. Then do SendKeys, which will send the text to VMWare, which in turn should send to guest OS, but I can't guarantee that.
     
    #2
      DiGiTAL.SkReAM

      • Total Posts : 1259
      • Scores: 7
      • Reward points : 0
      • Joined: 9/7/2005
      • Location: Clearwater, FL, USA
      • Status: offline
      RE: AutoIT ActiveX Saturday, April 19, 2008 2:06 AM (permalink)
      0
      Yeah, tried that and discarded it.
       
      To the sounds of much cursing, I might add.
       
      The current method I am undertaking requires me to boot the guest OS from a WinXPE cd (BartPE + the XPE plugin), and use a vbscript + AutoitX to perform the remote controls.
       
      Thanks!
      "Would you like to touch my monkey?" - Dieter (Mike Meyers)

      "It is better to die like a tiger, than to live like a pussy."
      -Master Wong, from Balls of Fury
       
      #3
        daluu

        • Total Posts : 53
        • Scores: 0
        • Reward points : 0
        • Joined: 4/17/2006
        • Status: offline
        RE: AutoIT ActiveX Saturday, April 19, 2008 6:20 AM (permalink)
        0
        Just wondering out of curiosity, what were/are you trying to do? From your comment, are you booting winXPE within VMWare or QEmu as a virtual machine or a real LiveCD boot to this OS instead of the guest OS?

        Another alternative if you have a spare PC is to put the guest OS on the spare PC and run VBScript + AutoItX on that machine to control it. You could also remotely call the VBScripts/AutoItX from your original host OS using something like PSTool's PSExec.exe - this method should work between a guest & host OS using VMWare as well, as long as networking is available.
         
        #4
          DiGiTAL.SkReAM

          • Total Posts : 1259
          • Scores: 7
          • Reward points : 0
          • Joined: 9/7/2005
          • Location: Clearwater, FL, USA
          • Status: offline
          RE: AutoIT ActiveX Sunday, April 20, 2008 4:55 AM (permalink)
          0
          To answer your question, I was needing to automate a process in a virtual machine (running under vmware.  Virtual Server is quick but lacks stability, and qemu is slow AND unstable.  VMWare Server running in WinXP is not too slow, and very stable.).  So, I was needing to send keystrokes/etc. to the OS running in the vmware vm.  But, I have since found a plugin that would allow me to run the same process under WinXPE, so I made an ISO, and mounted it as the CD in the virutal machine, and booted from that.  I then have the vbscript/autoitx run from the startup menu.
          Would rather have done it the other way, but this way works too.
           
          "Would you like to touch my monkey?" - Dieter (Mike Meyers)

          "It is better to die like a tiger, than to live like a pussy."
          -Master Wong, from Balls of Fury
           
          #5

            Online Bookmarks Sharing: Share/Bookmark

            Jump to:

            Current active users

            There are 0 members and 1 guests.

            Icon Legend and Permission

            • New Messages
            • No New Messages
            • Hot Topic w/ New Messages
            • Hot Topic w/o New Messages
            • Locked w/ New Messages
            • Locked w/o New Messages
            • Read Message
            • Post New Thread
            • Reply to message
            • Post New Poll
            • Submit Vote
            • Post reward post
            • Delete my own posts
            • Delete my own threads
            • Rate post

            2000-2012 ASPPlayground.NET Forum Version 3.9