VMware {code} Community
reisenhoferf
Contributor
Contributor

[1.8.1] RunProgramInGuest does not start a programm with a graphical user interface on a windows 7 system

Dear members,

Since some days I am trying to start a programm with a graphical user Interface on a windows 7 system by using the RunProgramInGuest function.

The code for this is like .

Inside the bat file I am performing some normal dos commands like "copy". They are working fine.

But I am also trying to exeucte a programm with a graphial user interface inside this batch.

This exe is not starting and the batch is stopping :-(.

In additon I found the hint . But VIX_CONSOLE_USER_NAME is not longer defined.

So how can I start a programm with a graphical user inferface on a windows 7 system by using the API version 1.8.1.

Thanks for your help.

Best Regards

Frank

job = vm(x).RunProgramInGuest("C:\windows\system32\cmd.exe", "/c c:\ExecuteBeforeShutdown.bat 2>&1 >>c:\out.txt", VixCOM.Constants.VIX_RUNPROGRAM_ACTIVATE_WINDOW, Nothing, Nothing)

If the program to run in the guest is intended to be visible to the user in the guest, such as an application with a graphical user interface, you must call VM::LoginInGuest() with VixCOM.Constants.VIX_CONSOLE_USER_NAME as the username and NULL (C++), null (C#), or Empty (VB) as the password before calling this function. This will ensure that the program is run within a graphical session that is visible to the user.

Reply
0 Kudos
1 Reply
reisenhoferf
Contributor
Contributor

Solved. It is VixCOM.Constants.VIX_LOGIN_IN_GUEST_REQUIRE_INTERACTIVE_ENVIRONMENT Smiley Happy

View

Reply
0 Kudos