Originally Posted by
CJ_London
no error message supplied
but my guess would be you are only providing a target path which does not include the file name
Also looks to me like you are trying to copy from a local folder to the server folder - the opposite of the thread header.
For the future, enclose your code with the code tags to preserve indentation (highlight the code and click the <> button). Code that is not indented is difficult to read and may explain why you have had a number of views but no responses until now
Hi. I am including the code again. You were right, I switched the source and target path:
HTML Code:
Dim FSO: Set FSO = CreateObject("Scripting.FileSystemObject")Dim strFile: strFile = "c:\temp\mytestfile.txt"Dim strTargetPath: strTargetPath = "\\10.200.11.4\Temp"
'verify the remote folder existsIf FSO.FolderExists(strTargetPath) Then'verify the source file existsIf FSO.FileExists(strFile) Then'use FSO.MoveFile <Source>,<Target> if you want to move instead of copyFSO.CopyFile strFile, strTargetPathElseMsgBox "ERROR: Source FIle does not exist or is not accessible."End IfElseMsgBox "ERROR: Target Folder does not exist or is not accessible."End If
Running the above code, I get the error "ERROR: Target Folder does not exist or is not accessible."
The sourcefile is fine - no error.
Thanks