eseabrook2008
Technical User
I'm trying to copy the contents of a remote folder to a local folder and overwrite the local contents. I'm running the script at logon via GPO. I get a permission error when the CopyFile command runs. The users do not have permission to edit the contents of the folder (if i log on as an administrator, the script runs fine). I've tried changing the permissions via a GPO but that doesn't seem to work. Is there something I can change in my script to run with higher privileges?
Dim objFSO
Dim strLocalDir, strNetworkDir, delLocalFile
strLocalDir = "C:\MCCG\IBSNT\BIN"
strNetworkDir = "\\xxx\public\IBSFILES"
' Create the File System Object
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set delLocalFile = objFSO.GetFile("c:\mccg\IBSnt\bin\ibsnt.exe")
' Check that the Directories exists
If objFSO.FolderExists(strLocalDir) Then
If objFSO.FolderExists(strNetworkDir) Then
delLocalFile.delete
objFSO.CopyFile "\\xxx\public\IBSFiles\*", "C:\MCCG\IBSNT\BIN\"
End If
End If
Dim objFSO
Dim strLocalDir, strNetworkDir, delLocalFile
strLocalDir = "C:\MCCG\IBSNT\BIN"
strNetworkDir = "\\xxx\public\IBSFILES"
' Create the File System Object
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set delLocalFile = objFSO.GetFile("c:\mccg\IBSnt\bin\ibsnt.exe")
' Check that the Directories exists
If objFSO.FolderExists(strLocalDir) Then
If objFSO.FolderExists(strNetworkDir) Then
delLocalFile.delete
objFSO.CopyFile "\\xxx\public\IBSFiles\*", "C:\MCCG\IBSNT\BIN\"
End If
End If