Specified path is invalid - Robocopy

0

I'm trying to copy a file from one directory to another using robocopy . This is the command from C#. /C is added since process is invoked from code.

/C ROBOCOPY \\\\35.8.1.147\\e$\\DATA\\Logs C:\\Copy /A-:SH Log1.log

Did not add quotes since file name does not have any spaces. But it fails with the following error

ERROR 161 (0x000000A1) Accessing Source Directory\\\\35.8.1.147\\e$\\DATA\\Logs
The specified path is invalid.
Waiting 30 seconds...

C# code for invoking process

p.StartInfo.Arguments = string.Format("/C ROBOCOPY {0} {1} /A-:SH {2}",
                        srcDirectory, "C:\\Copy", srcFileName);
                p.StartInfo.FileName = "CMD.EXE";
                p.StartInfo.CreateNoWindow = true;
                p.StartInfo.UseShellExecute = false;
                p.Start();
                p.WaitForExit();

But I'm able to manually access the file through explorer. What would be the reason?

c#
.net
cmd
robocopy
asked on Stack Overflow Mar 27, 2017 by Sudhir Somu • edited Mar 27, 2017 by Sudhir Somu

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0