Hi,
I'm trying to use permcopy to copy share ACL's on a set of user folders to a 'mirror image' of folders on another server.
i want to be able to read from a file and pass the strFolder ie folder name to the second half of my script.
I have this:
-----------------
On Error Resume Next
'open the script shell
set WSHShell = CreateObject("WScript.Shell")
set WSHShell = WScript.CreateObject("WScript.Shell")
'open the file
Set oTextStream = oFSO.OpenTextFile("flist.txt")
'make an array from the file
RemoteFOLDER = Split(oTextStream.ReadAll, vbNewLine)
'close the file
oTextStream.Close
For Each strFolder In RemoteFOLDER
Set objShell = CreateObject("WScript.Shell")
objShell.Run("""permcopy \\SERVERNAME"" & strFolder "\\SERVER2NAME""" & strFolder""")
Next
------------------------
It runs but there's no errors but nothing happens.
I can get the permcopy to run fine in a simple script eg:
-------------------
Set objShell = CreateObject("WScript.Shell")
objShell.Run("permcopy \\ssaserver username \\storage01 username")
So I guess somewhere in my bigger script my syntax is way off. I found something mentioning spaces etc and tried to fix it-syntax seems fine but still no good. Or have I got something wrong before that?
I'm trying to use permcopy to copy share ACL's on a set of user folders to a 'mirror image' of folders on another server.
i want to be able to read from a file and pass the strFolder ie folder name to the second half of my script.
I have this:
-----------------
On Error Resume Next
'open the script shell
set WSHShell = CreateObject("WScript.Shell")
set WSHShell = WScript.CreateObject("WScript.Shell")
'open the file
Set oTextStream = oFSO.OpenTextFile("flist.txt")
'make an array from the file
RemoteFOLDER = Split(oTextStream.ReadAll, vbNewLine)
'close the file
oTextStream.Close
For Each strFolder In RemoteFOLDER
Set objShell = CreateObject("WScript.Shell")
objShell.Run("""permcopy \\SERVERNAME"" & strFolder "\\SERVER2NAME""" & strFolder""")
Next
------------------------
It runs but there's no errors but nothing happens.
I can get the permcopy to run fine in a simple script eg:
-------------------
Set objShell = CreateObject("WScript.Shell")
objShell.Run("permcopy \\ssaserver username \\storage01 username")
So I guess somewhere in my bigger script my syntax is way off. I found something mentioning spaces etc and tried to fix it-syntax seems fine but still no good. Or have I got something wrong before that?