Multi Commander > Support and Feedback
Issue with .bat and robocopy.
nicedreams:
Been trying to create a new User Defined Command that I have set to Command Type=.bat
Using the below with robocopy and it will not work. The path's get screwed up. I've tried with quotes, without quotes, tried about every variable I can from the online docs and still comes out incorrect. http://multicommander.com/docs/multitags
robocopy "${sourcepath}" "${targetpath}" /TEE /MT /MIR /DCOPY:T /COPY:DAT /XD AppData /XJ /FFT /ZB /SEC /XA:SH /R:1 /W:1
pause
I've even tried
robocopy "${sourcepath}" "${targetpath}" and robocopy ${sourcepath} ${targetpath} and still same issue.
This is what I get and a different combo. I've actually gotten it to have a Dest, but then it gives me double quotes and other extras and gives an error.
========================================
Source : D:\scans" D:\testfolder"\
Dest -
Files : *.*
Exc Dirs : AppData
Options : *.* /FFT /TEE /S /E /DCOPY:DAT /COPY:DATS /PURGE /MIR /ZB /XJ /XA:SH
/MT:8 /R:1 /W:1
------------------------------------------------------------------------------
ERROR : No Destination Directory Specified.
Simple Usage :: ROBOCOPY source destination /MIR
source :: Source Directory (drive:\path or \\server\share\path).
destination :: Destination Dir (drive:\path or \\server\share\path).
/MIR :: Mirror a complete directory tree.
For more usage information run ROBOCOPY /?
**** /MIR can DELETE files as well as copy them !
Press any key to continue . . .
========================================
Mathias (Author):
${sourcepath} ${targetpath}
will return a quoted path so you do not need to insert " around them
you can do
--- Code: ---echo ${sourcepath} ${targetpath}
pause
--- End code ---
To just get an output of what the tags are translated to
ice-man:
First you need to figure out exactly what path you need to send to robocopy.
Then you need to compare that to the paths you get from MC.
And from that you should be able to figure out what differs and possible why it does not work.
nicedreams:
I've tried without the quotes and it's the same issue.
If I use "copy" or "xcopy" it work fine. It's just something between the variables and how robocopy is picking them up.
I'm trying to make a function to where when I have two panes open, it will use the robocopy /MIR to mirror the left pane to the right pane.
nicedreams:
Doing like you put above seems to get good results.
echo ${sourcepath} ${targetpath}
pause
But back to using robocopy and it puts them both on the source line for some reason. Like robocopy picks those variables up differently?
Want this to work as it makes it much easier than editing my batch script or manually doing this and changing the directories.
Navigation
[0] Message Index
[#] Next page
Go to full version