Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need a special file copy script

Status
Not open for further replies.

ChrisA07

MIS
Mar 11, 2001
11
US
OK, we have 2 W2K DCs at work connected via VPN over cable modem. These servers are also DFS (Distributed File System) servers.

Unfortunately, the VPN connection tends to drop and refuses to reconnect (I'm thinking it's a router problem, but that's another story), and at one point, the loss of connectivity causes a journal wrap error in DFS, so when I tried to recreate the DFS mapping, it caused the dreaded "move all of your files into *_NTFRS_xxxxxxxx folders" problem. Of course, it's now far too late to do an authoritative restore (files have been edited since then).

Long story short, I need a script that will:

1. Given a parent folder, will recursively search for files & subfolders.
2. Copy the contents of foldername to foldername_NTFRS_whatever the DFS-generated folder name is.
3. Copy the contents of foldername_NTFRS_whatever the DFS-generated folder name is BACK to foldername.

If anyone has run into this particular issue, I would surely appreciate the help, either if someone has a script to do this, or knows where I could find one on my own. Google et al has not been my friend on this.
 
'==========================================================================
'
' NAME: CopyDirRename.vbs
'
' AUTHOR: Mark D. MacLachlan , The Spider's Parlor
' URL: ' DATE : 1/5/2004
'
' COMMENT: Copies a folder and all sub folders and files to a new location
' Renames the folder after the copy is completed.
'==========================================================================

'Check all subfolders below given folder for size over a minimum size.
Dim FolderPath
Dim DestinationPath
Dim FinalPath

FolderPath= "C:\FolderName"
DestinationPath = "D:\FolderName_NTFRS"
FinalPath = "D:\FolderName"


Set FSO = CreateObject ("Scripting.FileSystemObject")

FSO.CopyFolder FolderPath, DestinationPath
FSO.MoveFolder DestinationPath, FinalPath
 
Mark,

Thanks, but this isn't quite what I need. I'm not sure if I'm explaining this right.

In our user folders, we might have User1, User2, etc. Let's say in User1, I have a folder stuff. In that folder is a folder morestuff.

When DFS failed & rebuilt, it renamed the folder \User1\stuff to \User1\stuff_NTFRS_a238ff52. It also renamed \User1\stuff\morestuff into \User1\stuff\morestuff_NTFRS_099ff2ae. It then proceeded to recreate the old folders with proper names and start copying data from the *_NTFRS_xxxxxxxx folders. It did not complete the task, however.

You're starting to sense my frustration here...

So, what I need is a script to copy the more recent files from the proper-named folders into the NTFRS folders to give them the most recent versions of the files. Then I need to copy THOSE files BACK over to the proper-named folders to get all of the data in the right places. Then I can safely delete the NTFRS folders.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top