VMware Communities
NickyD
Contributor
Contributor

VMRun.exe (Using Batch files with "net use" command)

I'm new to this community, but I was wondering if someone could shed some light on a problem I'm having.

when I use the vmrun.exe to programatically copy over a batch file and then run it. It executes, but does not behave the same way as if I launched it manually.

The command in my batch file is:

-


net use n:
daqserver\MI /USER:<Confidential> <Condidential>

pause

-


I used the pause to verify that it was not erroring out or anything.

Basically. The batch file should be able to add a new n: drive to my computer that is mapped to the network. But when launched programmatically. It says "Disconnected Network Drive"

At first. I thought it was a race error. Where maybe the programmatic version was going faster than I could manually. But it turns out... The programmatic way waits till the OS is 100% installed before launching the batch file.... while I can normally manually launched the batch file at 50% if I have to.

Any insight would be appreciated.

Regards,

NickyD

(I'm using VMWare Workstation 6.0.0 build-45731)

Here's the 2 vmrun commands:

C:\Documents and Settings\<Confidential>\Desktop>"C:\Program Files\VMware\VMware Workst

ation\vmrun.exe" -gu <Confidential> -gp <Confidential> copyFileFromHostToGuest "E:\VMware Im

ages\Copy (3) of ZZZZZZZZDO NOT COPY OVER WINXP SP2\English WinXP Pro SP2\Window

s XP Professional.vmx" "C:\Documents and Settings\<Confidential>\Local Settings\Temp\MI

Test.bat" "C:\Documents and Settings\<Confidential>\Desktop\MITest.bat"

C:\Documents and Settings\<Confidential>\Desktop>"C:\Program Files\VMware\VMware Workst

ation\vmrun.exe" -gu <Confidential> -gp <Confidential> runProgramInGuest "E:\VMware Images\C

opy (3) of ZZZZZZZZDO NOT COPY OVER WINXP SP2\English WinXP Pro SP2\Windows XP P

rofessional.vmx" "C:\Documents and Settings\<Confidential>\Desktop\MITest.bat"

When Batch File Programattically Run:

6677_6677.jpg

When Batch File Manually Run:

6676_6676.jpg

0 Kudos
1 Reply
xdeveshx
Enthusiast
Enthusiast

Sorry friend,

but your explanation is bit difficult to understand. Please tell me that what exactly you want to MAP ?

Are you mapping the Host drive in Guest OS or mapping drive or folder from Guest OS to Host machine. ??

0 Kudos