I am using
Set job = vm.RunProgramInGuest("c:\Windows\System32\wscript.exe", "C:\Copy.vbs", 0, Nothing, Nothing)
to run a simple script on the guest OS. The script is supposed to copy the latest installer for one of the products we develop from another machine. When I run this script on the guest everything works fine but when I run it using the VIX API call above, the script fails, saying the path is not found (800A004C). The problem appears on the last line of the code below. The script in both cases run using wscript.exe and under the same user account.
Dim fileSystem, file, files
Set fileSystem = CreateObject("Scripting.FileSystemObject")
Set fromFolder = fileSystem.GetFolder("
10.158.10.134\packages\dev-cm-python\asinstaller")
Any ideas what may be the problem?
LoginInGuest() sets user identity to the desired user, but it won't do all the actions of a login, so I suspect the network mount isn't available in the Vix situation.
So, the only way to copy files to the guest is through VIX API?
What happens if you do:
Set job = vm.FileExistsInGuest(\\10.158.10.134\packages\dev-cm-python\asinstaller", Nothing, Nothing) err = job.Wait(Array(VixCOM.Constants.VIX_PROPERTY_JOB_RESULT_GUEST_OBJECT_EXISTS), results) If results(0) Then WScript.Echo("File exists") Else WScript.Echo("File does not exist") End If