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