0

I'm trying to move a directory which certain date parameter to another directory.. This is the command I'm using: FORFILES -p C:\test1\ /S /D -3 /C "cmd /c if @isdir == TRUE move C:\test2\"

I want to move subdirectories inside test1 to the test2 directory if they meet those parameters. Right now, the script will move test2 to test1.... why is that?

1 Answer 1

0

If you only give the move command one parameter, it moves the given file/directory to the current directory. You need

FORFILES -p C:\test1\ /S /D -3 /C "cmd /c if @isdir == TRUE move @path C:\test2\"

so that move knows what file/directory (in @path) it should be trying to move.

1
  • Hi, Ok it worked, but 1 problem, if I have subdirectories under 'test1', it will only move files from 1 subdirectory, the other subdirectories he get 'cannot find the file' 1 dir(s) moved. ERROR: The system cannot find the file specified
    – Shlomi
    Mar 29, 2017 at 18:29

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .