Windows Thread, End of term copy files! in Technical; Hi all,
I'm back with the same question as last year hopefully some software has been found that can do ...
-
2nd August 2011, 08:56 AM #1
- Rep Power
- 0
End of term copy files!
Hi all,
I'm back with the same question as last year hopefully some software has been found that can do it!
What I'm wanting to do is copy all the Year 11 & 13 student's contents to a Buffalo box. But there's a catch! I've got to leave the root folder behind and delete all of it's contents when transferring? For the past 6 year's we've done this by hand 1 at a time & as you can tell - it's a pain in the a-s-s!
Can anyone save me?
Cheers
-
-
IDG Tech News
-
2nd August 2011, 09:10 AM #2 How about using Robocopy with a /move option?
-
-
2nd August 2011, 09:14 AM #3
- Rep Power
- 0
I looked at Robocopy last year but how would I make it keep the top folder? e.g.
\\hosea\d$\users\students\Joe.Bloggs - Just copies file's & leaves an empty Joe.Blogg's folder.
to
\\Server2\userbackup\Year11\Joe.Bloggs
-
-
2nd August 2011, 09:15 AM #4 Would it be quicker to move them and then recreate the folders?
-
-
2nd August 2011, 09:17 AM #5
- Rep Power
- 0
I suggested this but it would mess up AD folder settings as if the kid's come back they won't have a home area.
-
-
2nd August 2011, 09:17 AM #6 Copy out all of the contents to the new area
Use a batch script to recreate the root folders
-
-
2nd August 2011, 09:20 AM #7
- Rep Power
- 0
How would I go about keeping the folder settings within AD?
Cheers
-
-
2nd August 2011, 09:22 AM #8 As long as you keep the same folder names, it shouldn't be a problem.
-
-
2nd August 2011, 09:24 AM #9
- Rep Power
- 0
Do any of you have experience with the Robocopy option?
-
-
2nd August 2011, 09:49 AM #10 I'd try this -
1) Export a list of usernames from AD to a text file
2) Write a script which:
a) maps drive Y: to \\hosea\d$\users\students\
b) maps drive Z: to \\Server2\userbackup\Year11\
c) Reads in username from text file
d) Creates new folder Z:\username
e) Robocopy Y:\username to Z:\username such that it moves the data
-
-
2nd August 2011, 10:04 AM #11 thinking ahead for next time, I would create a folder called Files, or Work or similar inside each of the students folders that they can use to save work then all you would need to do is copy the entire folder structure to your backup then do a search for folders called work and delete them, therefore keeping the root folder of the student intact.
i.e create \\hosea\d$\users\students\%username%\Files
In AD alter the location of the the home drive to this new folder and it wont look any different to the students.
-
-
2nd August 2011, 10:31 AM #12 This may be a daft way to do it but I map each year group folder and then do a search of all files on that mapped drive. I can then sort and block copy/delete. It's the only way I have found to deal with long files names.
-
-
2nd August 2011, 02:59 PM #13
- Rep Power
- 0
Sorry the reason we can't delete the root folder is because we want to keep the permissions on said folder.
-
-
3rd August 2011, 10:49 AM #14
- Rep Power
- 0
What do people think to....
Using a script to copy a list of the student's names taken from AD to xfer files from A to B.
Then is there a way I can use Robocopy to delete the content's of multiple folders but leave the main header folder?
e.g. Leave Joe.Blogg but remove all of it's contents?
-
-
3rd August 2011, 11:36 AM #15 This could be a fairly simple script and as such I have put something together for you. It only currently looks at your folders and echos the robocopy command it would use. It only needs one more line of code to be live.
Use this at your own risk!
You need to decide what robocopy options you need as I just guessed so try on one student folder first by using robocopy at the cmd line.
Please run it from the command line for testing eg Code:
cscript movefiles.vbs
unless you like pressing ok on a dialogue box for the number of student folders you have.
Save this code into a folder called movefiles.vbs (or whatever you like)
Code:
Set FSO = CreateObject("Scripting.FileSystemObject")
Const ORIGINAL_ROOT = "D:\Test" ' Source folder
Const DEST_ROOT = "D:\Test2" ' Destination folder
Set objFolder = FSO.GetFolder(ORIGINAL_ROOT)
Set objShell = CreateObject("WScript.Shell")
strCmdLine = ""
Const ROBO_OPTIONS = "/e /zb /copyall /r:3 /w:15 /MOVE" ' Change these robocopy switches to what you want
For Each Subfolder in objFolder.SubFolders
Wscript.Echo "Currently looking at: " & Subfolder.Path & VbCrLf ' For testing to show which folder
strCmdLine = "Robocopy " & Subfolder.Path & "\*.* " & DEST_ROOT & "\" & subfolder.name & " " & ROBO_OPTIONS ' to build the cmd line that will run
Wscript.echo strCmdLine ' to show the cmd line that will run
'ShowSubFolders Subfolder
Next Let me know how you get on and I will help you finish it if you want to use it.
Last edited by ChrisH; 3rd August 2011 at 11:50 AM.
Reason: Code mistake
-
3 Thanks to ChrisH:
Haux (3rd August 2011), nephilim (3rd August 2011), Oaktech (3rd August 2011)
SHARE:
Similar Threads
-
By witch in forum General Chat
Replies: 23
Last Post: 18th December 2009, 09:49 AM
-
By SpecialAgent in forum Educational IT Jobs
Replies: 2
Last Post: 23rd November 2009, 11:23 AM
-
By SteveB_NI in forum General Chat
Replies: 10
Last Post: 29th June 2009, 09:53 AM
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
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