VMware Communities
Ashpoint
Contributor
Contributor
Jump to solution

BAT file to auto start several VMs

I am trying to use the VMware.exe software to auto start my (three) VMs when my Windows desktop restarts.

I created a .BAT file creating three lines of code in the Startup folder of the host.

Each line is similar to:

"C:\Program Files (x86\vmware\vmare workstation\VMWare.exe" -x "c:\users\admin\Documents\Virtual Machines\vm1\vm1.vmx"

Each line calls the next VM to start.

My problem is that  the batch file  will execute the first line  ( that is - start the first VM) but will not progress  to the second and third lines ( thereby starting the second and third  VMs )

Each line of code works perfectly if entered  manually and individually into the RUN command of the host.

What am I missing here?

0 Kudos
1 Solution

Accepted Solutions
Ashpoint
Contributor
Contributor
Jump to solution

Hi WoodZ and jmtella

A big THANK YOU to you.  The vmRun command was the answer.

The attached file renamed as StartVM.bat works for me...

I welcome your critical comment

Cheers,

Michael

View solution in original post

0 Kudos
8 Replies
jmtella
Enthusiast
Enthusiast
Jump to solution

start " " "C:\Program Files (x86\vmware\vmare workstation\VMWare.exe" -x "c:\users\admin\Documents\Virtual Machines\vm1\vm1.vmx"

0 Kudos
Ashpoint
Contributor
Contributor
Jump to solution

Thank you jmtella for responding and so promptly.

Yes, tried that - didn't work!

I put the START at the beginning of the first line of code only.

Line 1 (with START...), I get a Wndows Message Box saying "Windows cannot find '-x'make sure you typed the name correctly and then try again.

I click OK and the second line (without the START) starts the Workstation and the VM2 VM.

The .bat file is now hung.

It is like the command line is executed but doesn't terminate.

0 Kudos
WoodyZ
Immortal
Immortal
Jump to solution

What Host OS version?

What VMware Product version?

Have you tried not using start?

Is the Batch file extension .bat or .cmd?

Why not use vmrun?

0 Kudos
Ashpoint
Contributor
Contributor
Jump to solution

Thank you WoodyZ

Host OS is Windows 8.1 Enterprise 64-bit. 8gb RAM.  HP Z230

VMware Workstation V: 10.0.1 build 1379776

START produces a MessageBox error (see prior responses)

.BAT, .CMD - Using .BAT will test .CMD later in day.

vmrun:  Didn't know about that command.  Will test later in the day (staff arrived so playing with the system is not available to me now <sob>

Cheers,

Michael

0 Kudos
jmtella
Enthusiast
Enthusiast
Jump to solution

syntax:

start " " "YOUR_COMANND"

NOTE: " " previous  !!!!!!!

0 Kudos
Ashpoint
Contributor
Contributor
Jump to solution

Hi WoodZ and jmtella

A big THANK YOU to you.  The vmRun command was the answer.

The attached file renamed as StartVM.bat works for me...

I welcome your critical comment

Cheers,

Michael

0 Kudos
SMKAMRAN
Contributor
Contributor
Jump to solution

you can try this and this will work defiantly.

cd "C:\Program Files (x86)\VMware\VMware Workstation"

vmware -x "D:\server\Server-share\Windows Server 2003 Enterprise Edition.vmx"

Kindly change the .vmx file path or location and save this file .bat as you have opened it in notepad. And now make the scheduler to run this .bat file when your computer or server starts that's it.

Thanks & Regards,

S.M.Kamran

(VMWare Specialist - Pakistan)  

0 Kudos
WoodyZ
Immortal
Immortal
Jump to solution

SMKAMRAN wrote: you can try this and this will work defiantly.

Are you sure about that!? Smiley Wink  Maybe a better adverb would be, definitely.

0 Kudos