Scripts Thread, Script to copy folders to multiple PCs simultaneously in Coding and Web Development; Hi,
I often have to copy folders to multiple PCs in labs and have created a script to read the ...
-
3rd November 2011, 05:16 PM #1
- Rep Power
- 0
Script to copy folders to multiple PCs simultaneously
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
-
-
IDG Tech News
-
3rd November 2011, 05:33 PM #2 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.
-
-
3rd November 2011, 06:48 PM #3
- Rep Power
- 0
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
-
-
3rd November 2011, 06:51 PM #4 
Originally Posted by
Rob414
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.
-
SHARE: 
Similar Threads
-
By tosca925 in forum Scripts
Replies: 3
Last Post: 26th October 2012, 02:15 PM
-
By DaveP in forum Downloads
Replies: 6
Last Post: 12th September 2011, 10:24 AM
-
By sradams1977 in forum Scripts
Replies: 21
Last Post: 29th December 2007, 10:53 PM
-
By timbo343 in forum Scripts
Replies: 15
Last Post: 19th September 2007, 10:46 PM
-
By tosca925 in forum Windows
Replies: 6
Last Post: 20th October 2005, 06:48 PM
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules