Jump to content

Script to copy folders to multiple PCs simultaneously


Recommended Posts

Posted

Hi,

I often have to copy folders to multiple PCs in labs and have created a script to read the name of the PC from a txt file, read the name of the folder from a txt file and copy out to the machines as bellow. Problem is I need it to copy out to the PCs in the txt file simultaneously. I’m copying VM’s that can be up to 25Gb in size so it’s not viable to copy out to just one machine at a time or it’ll be running all day! Is this possible??

 

Script I’ve got so far is:

 

 

InputmachineFile = "C:\VMDEPLOYMENT SCRIPTS\machinelist.Txt"

Inputvmfile = "C:\VMDEPLOYMENT SCRIPTS\vmlist.txt"

 

strFolderroot = "\\staffclus\issimages$\VMWare\VM Labs 2011-12\C-Drive"

machinecount=0

vmcount=0

 

Const OverwriteExisting = True

 

Set objFSO = CreateObject("Scripting.FileSystemObject")

 

Set objmachineFile = objFSO.OpenTextFile(InputmachineFile)

Set objvmFile = objFSO.OpenTextFile(InputvmFile)

 

Do While Not (objvmFile.AtEndOfStream)

strvm = objvmFile.ReadLine

 

strfolderName = strFolderroot & "\" & strvm

Do While Not (objmachineFile.AtEndOfStream)

 

strComputer = objmachineFile.ReadLine

 

objFSO.Copyfolder strfolderName, "\\" & strComputer & "\C$\VMware\"

strComputer = ""

 

machinecount=machinecount+1

Loop

objmachineFile.close

Set objmachineFile = objFSO.OpenTextFile(InputmachineFile)

 

vmcount=vmcount+1

strvm=""

foldername=""

Loop

MsgBox "Done " & machinecount & " " & vmcount

 

I’m a complete novice at this so any help would be great :)

Rob

Posted

It would hammer the computer startup times but why not do it through group policy?

 

As a total and utter off topic alternative if you are dealing with VMs in a testing enviroment you could always get something like a HP DL385 G7 server and set it up with Hyper-V and System Centre Virtual Machine Manager with the self service portal setup for your labs users - they would then be able to setup and run their own VMs (indipendant of each other) on the Hyper-V server.

Posted

Thanks for reply Jamesfed, but not an option i'm afraid. I already get grief about log in times as it is and it's only 4mins! lol

The VMs are actually used in 60 odd student labs and just need to be copied out once, then the machine is frozen so they can be returned to original state.

 

Cheers,

Rob

Posted
Thanks for reply Jamesfed, but not an option i'm afraid. I already get grief about log in times as it is and it's only 4mins! lol

The VMs are actually used in 60 odd student labs and just need to be copied out once, then the machine is frozen so they can be returned to original state.

 

Cheers,

Rob

 

I'd have a look at my 2nd option then - would be expensive but maybe something for the long run :) You can do some pretty impressive things in Hyper-V.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



  • 33 When would you like EduGeek EDIT 2025 to be held?

    1. 1. Select a time period you can attend


      • I can make it in June\July
      • I can make it in August\Sept
      • Other time period. Comment below
      • Either time

×
×
  • Create New...