Skip to content

Instantly share code, notes, and snippets.

@gotcake
Last active August 29, 2015 13:56
Show Gist options
  • Save gotcake/9003971 to your computer and use it in GitHub Desktop.
Save gotcake/9003971 to your computer and use it in GitHub Desktop.
@echo off
REM Configuration Parameters
set domain=istlabs
set user_name=adc2619
set share=\\Zarek\Cylon
set mount_drive=Z:
set remote_vm_root=%mount_drive%\VM Images\Working
set local_vm_root=C:\Users\student\Desktop
REM there must not be spaces in these names!
set virtual_machines=STU_2K12_Linked_Clone STU_CentOS5.9_32_Linked_Clone VL_WIN7_32_Linked_Clone Vyatta6.6_R1_Linked_Clone
REM this will prompt the user for the password when it connects, if necessary
echo Connecting to the remote share...
net use %mount_drive% %share%\%user_name% /user:%domain%\%user_name%
REM this will copy the files to a location on the local machine
echo Copying files...
for %%m in (%virtual_machines%) do (
mkdir "%local_vm_root%\%%m"
xcopy "%remote_vm_root%\%%m" "%local_vm_root%\%%m" /E /Y
)
echo Complete!
pause
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment