Forum posts for vmware.exe

Compare file creation dates from the command prompt

At my university, we use VMware quite extensively to allow experimentation of admin tasks on otherwise heavily locked down computers. I use the same VM's at home so I don't have to worry about the cluttered environment of my native PC, by copying it to and from my USB flash drive.

The VM I use is snapshot'd with all the settings I like, and set to revert to snapshot on shutdown, so ideally it never changes. As I use multiple computers, I have a script that checks if the VM is present, and if not, copies it over and schedules an auto-open on next login.

My current script looks like this:

@echo off

if exist 'C:Users[Username]DesktopWin7x86Win7x86.vmx' goto open
if not exist 'C:Users[Username]DesktopWin7x86Win7x86.vmx' echo VM files not found, preparing to copy from USB
goto usb

:usb
if exist 'F:' goto copy
if not exist 'F:' echo Please insert USB drive.
pause
goto usb

:copy
robocopy 'F:Virtual MachinesWin7x86' 'C:Users[Username]DesktopWin7x86' /mir /eta
schtasks /create /ru [Username] /rp [Password] /xml '%cd%Win7x86 Opener.xml' /tn 'Win7x86 Opener'
goto open

:open
PATH '%PROGRAMFILES%VMwareVMware Workstation'
START vmware.exe -x 'C:Users[Username]DesktopWin7x86Win7x86.vmx'


My problem is this; sometimes I make change to the VM, and update the snapshot.

I want my script to compare the creation dates of the source files (USB) to the local files (desktop). If the local are newer, then obviously it's been copied since the last update and is fine to run, but if the source files are newer, then the local needs updating.

I plan on using vmware.log as the comparison file as it's small and retains it's creation date (some VM files are deleted and re-created during the VM running process).

I've scoured the internet and the best I found compared dates and listed the newest; but with my very limited batch scripting knowledge, I have no idea how to pipe a robocopy command off that output.

View complete forum thread with replies

Other posts related to vmware.exe

See Related Forum Messages: Follow the Links Below to View Complete Thread

which vmware server is a better choice and which host OS (for QE)
Continue batch script only after program has booted
VMWARE Workstation does not open any virtual machine [SOLVED]
Compare file creation dates from the command prompt

What is the carbon footprint of your coffee?

Is it low? Is it high? Can this things really kill the planet Earth? Maybe the answer will surprise you. Maybe not.