networkn
asked on
Script to copy directories only
Hi There!
I want to copy a directory structure from our server to a hard disk for the company doing our acquisition to use. I don't want to copy ANY files, just the folders, so they can see the structure of the folders. I think robocopy does it but I couldn't get it working.
Script needs to run seamlessly on Windows 2008 Server
Thanks in advance.
I want to copy a directory structure from our server to a hard disk for the company doing our acquisition to use. I don't want to copy ANY files, just the folders, so they can see the structure of the folders. I think robocopy does it but I couldn't get it working.
Script needs to run seamlessly on Windows 2008 Server
Thanks in advance.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Legen... Wait for it... DARY!
Thanks
Thanks
Please try the following vbscript
Modify the source folder and destination folder
**************************
source_Folder = "c:\backup" 'path of directory
dest_Folder="d:\backup" ' Path where the directory structure is to be created
On Error resume next
Set objFSO = CreateObject("Scripting.Fi
Set objFolder = objFSO.GetFolder(source_fo
WScript.Echo Replace(LCase(objFolder.Pa
objfso.CreateFolder Replace(LCase(objFolder.Pa
ShowSubFolders(objFolder)
Sub ShowSubFolders(objFolder)
Set colFolders = objFolder.SubFolders
For Each objSubFolder In colFolders
WScript.Echo objSubFolder.Path
objfso.CreateFolder Replace(LCase(objSubFolder
ShowSubFolders(objSubFolde
Next
End Sub