Link to home
Start Free TrialLog in
Avatar of wasabi3689
wasabi3689Flag for United States of America

asked on

Why cannot copy this file?

I run the following script .cmd file



@echo off
setlocal enabledelayedexpansion

set startTime=%Date% %time%
echo Start Time: %startTime%

Robocopy /s \\Image1\Images\ICSStorage\20080211\C43F9AAF-B3F1-46EC-A2BE-E3B8BED78B7E.tif      \\testsql3\NGProductionDocs\NGSourceDocs\ICSStorage\20080211\C43F9AAF-B3F1-46EC-A2BE-E3B8BED78B7E.tif      /dcopy:t /mir /FFT /Z /np /tee /log+:D:\NGProductionDocs\Config\Log\CopyOverLog\CopyOver_ICSStorage.log
      

echo Finish Time: %Date% %time%
pause

I have the following error

'\\testsql3\Config\Maintenance\NGPRDToTestSQL3'
CMD.EXE was started with the above path as the current directory.
UNC paths are not supported.  Defaulting to Windows directory.
Start Time: Sun 01/13/2019  0:07:31.87

 Log File : D:\NGProductionDocs\Config\Log\CopyOverLog\CopyOver_ICSStorage.log

-------------------------------------------------------------------------------
   ROBOCOPY     ::     Robust File Copy for Windows

-------------------------------------------------------------------------------

  Started : Sun Jan 13 00:07:31 2019

   Source : \\Image1\Images\ICSStorage\20080211\C43F9AAF-B3F1-46EC-A2BE-E3B8BED7
8B7E.tif\
     Dest : \\testsql3\NGProductionDocs\NGSourceDocs\ICSStorage\20080211\C43F9AA
F-B3F1-46EC-A2BE-E3B8BED78B7E.tif\

    Files : *.*

  Options : *.* /FFT /TEE /S /E /COPY:DAT /DCOPY:T /PURGE /MIR /Z /NP /R:1000000
 /W:30

------------------------------------------------------------------------------

2019/01/13 00:07:31 ERROR 267 (0x0000010B) Accessing Source Directory \\Image1\I
mages\ICSStorage\20080211\C43F9AAF-B3F1-46EC-A2BE-E3B8BED78B7E.tif\
The directory name is invalid.
Finish Time: Sun 01/13/2019  0:07:31.95
Press any key to continue . . .


Can you tell what went wrong with my script?
ASKER CERTIFIED SOLUTION
Avatar of Qlemo
Qlemo
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Try map the paths with a letter before start robocopy, after the copy you can remove the mapping
Have you tried putting the source and seat path in "\\server\folder"

Also are you trying to just include the single tif file or the whole directory content?
Avatar of wasabi3689

ASKER

I cannot just copy the entire folder, there will be too many files in the folder. I just want to copy the some files within the folder. If I don't use robocopy, can I just use just copy command to copy the folder name and that file. If so, how to construct  the line
Your command, if used as shown in my comment, will copy a single file.
But what do you really want to do? The syntax used doesn't really makes sense, e.g because you name a single file but use /s to copy subfolders too.
For a single file I would say 100% yes