Hi Everyone,
I am using some code kindly provided by snotmore...
Is there a way to make the above work with a UNC?
I love the way the code dynamically creates the folders if they don't exist and is exactly what I need but it needs to work over the network to a UNC share. I think the \\ at the beginning of a UNC is what's causing this to not work.
Any ideas?
To give a little background, I'm backing up a file located on an RDSH server that resides in the %localappdata% folder. I'm saving this to a specific folder on the network based on the users login name. When the user logs in again, another script using slightly different source and destination folders will copy the data back. Therefore, on the restore, the above works great... just the backup that fails.
I am using some code kindly provided by snotmore...
Code:
Call subCreateFolders("C:\test1\test2\test3\")
Sub subCreateFolders(strPath)
Dim objFileSys
Dim strPath, strNewFolder
Set objFileSys = CreateObject("Scripting.FileSystemObject")
If Right(strPath, 1) <> "\" Then
strPath = strPath & "\"
End If
strNewFolder = ""
Do Until strPath = strNewFolder
strNewFolder = Left(strPath, InStr(Len(strNewFolder) + 1, strPath, "\"))
If objFileSys.FolderExists(strNewFolder) = False Then
objFileSys.CreateFolder(strNewFolder)
End If
Loop
End Sub
Is there a way to make the above work with a UNC?
I love the way the code dynamically creates the folders if they don't exist and is exactly what I need but it needs to work over the network to a UNC share. I think the \\ at the beginning of a UNC is what's causing this to not work.
Any ideas?
To give a little background, I'm backing up a file located on an RDSH server that resides in the %localappdata% folder. I'm saving this to a specific folder on the network based on the users login name. When the user logs in again, another script using slightly different source and destination folders will copy the data back. Therefore, on the restore, the above works great... just the backup that fails.