+ Post New Thread
Results 1 to 4 of 4
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 ...
  1. #1

    Join Date
    Oct 2011
    Location
    Glasgow
    Posts
    22
    Thank Post
    1
    Thanked 0 Times in 0 Posts
    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

  2. #2
    jamesfed's Avatar
    Join Date
    Sep 2009
    Location
    Reading
    Posts
    2,139
    Thank Post
    126
    Thanked 325 Times in 274 Posts
    Rep Power
    81
    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.

  3. #3

    Join Date
    Oct 2011
    Location
    Glasgow
    Posts
    22
    Thank Post
    1
    Thanked 0 Times in 0 Posts
    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

  4. #4
    jamesfed's Avatar
    Join Date
    Sep 2009
    Location
    Reading
    Posts
    2,139
    Thank Post
    126
    Thanked 325 Times in 274 Posts
    Rep Power
    81
    Quote Originally Posted by Rob414 View Post
    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:
+ Post New Thread

Similar Threads

  1. Replies: 3
    Last Post: 26th October 2012, 02:15 PM
  2. Replies: 6
    Last Post: 12th September 2011, 10:24 AM
  3. Replies: 21
    Last Post: 29th December 2007, 10:53 PM
  4. Replies: 15
    Last Post: 19th September 2007, 10:46 PM
  5. 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
  •