Link to home
Start Free TrialLog in
Avatar of glenn masters
glenn masters

asked on

Need help in finishing off a robocopy script.

I have the following robocopy script of which is 90 % there but just need it to delete the subfolders from "C:\CHILTERNDOWNLOADS" when the files have transferred.

Any Ideas on the command?

Thanks
Robocopy "C:\CHILTERNDOWNLOADS" "S:\CCTV Downloads\Chiltern Downloads" /S /MOV /R:10 /W:5 /V /ETA

Open in new window

Avatar of chirkware
chirkware
Flag of United States of America image

Have you tried /MOVE rather than /MOV.  Per the documentation:  

/MOV :: MOVe files (delete from source after copying).
/MOVE :: MOVE files AND dirs (delete from source after copying).

Of course, I may not be understanding what you are trying to do...
In a .bat/.cmd file:
for /d %%a in (C:\CHILTERNDOWNLOADS\*) do (
   rd /s /q "%%a"
)

Open in new window


On the CMD prompt:
for /d %a in (C:\CHILTERNDOWNLOADS\*) do rd /s /q "%a"

Open in new window

Avatar of glenn masters
glenn masters

ASKER

Tried

/MOVE :: MOVE files AND dirs (delete from source after copying).

It deletes the  folders  from "C" drive when complete.l  I only need it to transfer  and delete the SUB folders and keep the original.

What NVIT put does can that be added to end of robocopy??
ASKER CERTIFIED SOLUTION
Avatar of NVIT
NVIT
Flag of United States of America 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
SOLUTION
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
No reason why all In 1 line I always thought they were 1 line only .
Big thanks friends