File shift by Raistlin


User avatar
Raistlin
I am still reasonably competent in manipulating MSDOS but I'm having some difficulty writing a simple batch file for some reason that will work in Windows 7.

I want to copy all the files in one sub-folder to another sub folder, deleting the originals once the copies have been made.

Can anybody offer suggestions please?

I seem to end up with syntax errors, or they don't get copied or they don't get deleted.

It should be a simple task for me but it's turning into a nightmare :(

Thanks.
Paul

Cogito ergo sum... maybe?

Click the image to go to Nano-Meet Website
Image

Posted 09 Oct 2015, 17:58 #1 

User avatar
Raistlin
ROBOCOPY is, I think, the required command but I keep getting a message stating that the destination folder is an invalid parameter

HELLLP?
Paul

Cogito ergo sum... maybe?

Click the image to go to Nano-Meet Website
Image

Posted 09 Oct 2015, 18:17 #2 

Last edited by Raistlin on 09 Oct 2015, 18:32, edited 1 time in total.

User avatar
Bernard
I don't remember that command in DOS. Is it specific to windows applications?
I don't like signatures, they take up too much screen space.

Posted 09 Oct 2015, 18:22 #3 

User avatar
Raistlin
I think so Bernard, although it was available as part of a development kit previously, but how far back I can't say.

It is like XCOPY on steroids.
Paul

Cogito ergo sum... maybe?

Click the image to go to Nano-Meet Website
Image

Posted 09 Oct 2015, 18:33 #4 

User avatar
Bernard
My understanding of computers ended with windows.
I don't like signatures, they take up too much screen space.

Posted 09 Oct 2015, 19:28 #5 

User avatar
Jürgen
(Site Admin)
Robocopy (originally from Sysinternals) is quite a sophisticated tool and should do the job, Paul. This is an example for moving a directory, the destination doesn't need to exist:

robocopy C:\path_to\source\ C:\path_to\destination\ /E /move /r:1 /w:1 /reg /L

/L will prevent robocopy from doing anything but listing what it would do with all the parameters provided. So remove it when no error shows up.

Setting the retry and wait limits is important, else you'd have to wait a very long time for every error! Have a look at the default values (robocopy /?). I suggest adding the /reg option as well, then you won't need to set these two parameters again.

Add /TBD when using a UNC-path (\\server\share\) instead of a drive letter.

Add /copyall if you need to transfer all the NTFS permissions as well. And run it as administrator.

Posted 09 Oct 2015, 19:39 #6 

User avatar
Raistlin
Thanks Jürgen. Sorted out now :)
Paul

Cogito ergo sum... maybe?

Click the image to go to Nano-Meet Website
Image

Posted 10 Oct 2015, 15:40 #7 


Top

cron