Quantcast
Channel: VMware Communities: Message List
Viewing all articles
Browse latest Browse all 189012

Error while executing srcipt on a VM Guest using Invoke-VMScript

$
0
0

Hello All,

 

I am trying to run an executable on a VM guest OS. Here is the command that I use:

 

Connect-VIServer -Server 10.1.1.20

$script='&"C:\Windows\System32\notepad.exe"'

Invoke-VMScript -ScriptText $script -VM MyVM

 

This throws the following error:

Invoke-VMScript : 7/8/2013 11:27:05 AM   Invoke-VMScript    Could not find file 'C:\Users\Administrator.VIA\AppData\Local\Temp\2\oko6komk.dll'.

At line:1 char:16

+ Invoke-VMScript <<<<  -ScriptText $script -VM MyVM

     + CategoryInfo             : NotSpecified: (:) [Invoke-VMScript], ViError

     + FullyQualifiedErrorId  : Client20_ClientSideTaskImpl_ThreadProc_UnhandledException,VMware.VimAutomation.ViCore.Cmdlets.Commands.InvokeVmScript

 

Whereas the following command succeeds:

Invoke-VMScript -ScriptText "dir" -VM MyVM

 

However once I start getting the error, even "dir" command does not work.

 

If you know the solution please let me know.

Thanks in advance.

Best Regards,

Bijesh


Viewing all articles
Browse latest Browse all 189012

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>