Guest Posted January 4, 2010 Posted January 4, 2010 How can I get this to work without errors?FOR %%i IN (file1.extfile2.extfile3.ext) DO IF EXIST %%i (if not exist Folder md Folder & move /y %%i Folder)This stops moving files after the first one because folder has been created. I would like it to continue.If I leave out "if not exist Folder" if makes the directory and moves the files but the it shows an error after the first one that directory already exists.
Yzöwl Posted January 4, 2010 Posted January 4, 2010 You can fix it by adding some parentheses in order to help the command interpreter understand exactly which bits belong where.@ECHO OFFFOR %%i IN (file1.ext file2.ext file3.ext) DO ( IF EXIST %%i ((IF NOT EXIST Folder MD Folder) & MOVE /Y %%i Folder))
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now