VMware Cloud Community
NikhilPathak
Enthusiast
Enthusiast
Jump to solution

Execute an EXE using Invoke-VMScript.

The setup.exe is available on a Shared folder as "\\ABCMASTER\ESIS\setup.exe"

using powercli command

$installscript = '

C:\Windows\System32\Notepad.exe

\\ABCMASTER\ESIS\setup.exe

'

$invokeinstalltask = Invoke-VMScript -ScriptText $installscript -VM $VM.name -GuestUser "administrator" -GuestPassword "Password1"

it doesn't invoke the setup dialog box.

but when i run commands inside the VM, it works fine.

Can any one guide me on how to accomplish this task.

0 Kudos
1 Solution

Accepted Solutions
lukebes1010
Enthusiast
Enthusiast
Jump to solution

Hi,

as workaround - you can add a scheduled task (with required exe) via Invoke-VMScript. it should behave like a local execution.

---------------------------------------------------------------------------------------------------------

Was it helpful? Let us know by completing this short survey here.

View solution in original post

0 Kudos
11 Replies
LucD
Leadership
Leadership
Jump to solution

All scripts and commands you execute through Invoke-VMScript shall be 'silent'.

In other words, no prompts and no dialogue boxes.

Most of the installation programs nowadays have such a silent option.

A good source for silent installation is, besides the manufacturer of the SW, the ITNinja website.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
NikhilPathak
Enthusiast
Enthusiast
Jump to solution

Thanks LucD.

Currently, do we have any other way to invoke the application?

0 Kudos
LucD
Leadership
Leadership
Jump to solution

I'm afraid not.
Which application are you looking at?
Isn't it showing installation options when you add a -help or /help parameter?


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
NikhilPathak
Enthusiast
Enthusiast
Jump to solution

The exe which i intend to run is a software exe.

We have a product which i need to install on selected VM's.

0 Kudos
NikhilPathak
Enthusiast
Enthusiast
Jump to solution

It runs as a Background process but doesn't bring up the UI

Is it possible to show the UI for an Background process.

0 Kudos
LucD
Leadership
Leadership
Jump to solution

No, I'm afraid not.
You will have to run the EXE as a silent install.

Which EXE are we talking about?
Did you try starting it from a CMD prompt with a /? or a /h or a -help... parameter?


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
lukebes1010
Enthusiast
Enthusiast
Jump to solution

Hi,

as workaround - you can add a scheduled task (with required exe) via Invoke-VMScript. it should behave like a local execution.

---------------------------------------------------------------------------------------------------------

Was it helpful? Let us know by completing this short survey here.

0 Kudos
LucD
Leadership
Leadership
Jump to solution

I'm not sure how a Scheduled Task will fix the problem of an interactive installation GUI.
The solution, imho, is to run a "silent" installation,provided the installation EXE has this option.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
NikhilPathak
Enthusiast
Enthusiast
Jump to solution

Hi Lukebes1010,

Thanks, that did work, but the problem is that the exe doesnt come up when the VM is looged off. It works fine if the VM is logged in.

Do we have any workaround for it.

0 Kudos
jpsider
Expert
Expert
Jump to solution

Are you looking to have the entire software installed? or just have it open up to a dialog so you can manually finish the install? I'm a bit confused as to what your goal is...

0 Kudos
NikhilPathak
Enthusiast
Enthusiast
Jump to solution

Hi jpsider,

Current scope is to invoke the Installation UI.

0 Kudos