RunPrograminGuest not working with VIX_RUNPROGRAM_ACTIVATE_WINDOW

117 views
Skip to first unread message

Sanket Panchamia

unread,
Aug 5, 2014, 1:13:55 AM8/5/14
to vmwar...@googlegroups.com
Hi,

I know there have been multiple issues regarding the RunPrograminGuest API. I couldnt find anyone in the forum that could answer my query.
This one came really close and i tried the same steps but to no avail

This is the code i use along with the VMWareTasks library

            // declare a virtual host
            VMWareVirtualHost virtualHost = new VMWareVirtualHost();
            // connect to a local (VMWare Workstation) virtual machine
            virtualHost.ConnectToVMWareWorkstation();
            // open an existing virtual machine
            VMWareVirtualMachine virtualMachine = virtualHost.Open("C:\\Users\\sapancha\\Documents\\Virtual Machines\\Windows 7 x86\\Windows 7 x86.vmx");
            // power on this virtual machine
            virtualMachine.PowerOn();
            // wait for tools to launch
            virtualMachine.WaitForToolsInGuest();
            // login to the virtual machine
            virtualMachine.LoginInGuest("username", "password");
            // run notepad
            virtualMachine.RunProgramInGuest("C:\\Windows\\system32\\notepad.exe ", string.Empty, Constants.VIX_RUNPROGRAM_ACTIVATE_WINDOW, 10);

The code runs fine but on the VM, the notepad doesnt run in an active window but i can see it as a process in my Task Manager. Not sure what else i can do to get over this.

Any help will be appreciated.

Thanks
Sanket

Daniel Doubrovkine

unread,
Aug 6, 2014, 6:54:20 AM8/6/14
to vmwar...@googlegroups.com
You cannot see it, it targets a different desktop (not desktop 0). I think there's nothing you can do about this.


--
You received this message because you are subscribed to the Google Groups "vmwaretasks" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vmwaretasks...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

dB. | Moscow - Geneva - Seattle - New York
code.dblock.org - @dblockdotorg - artsy.net - github/dblock

Reply all
Reply to author
Forward
0 new messages