-
November 19th, 2010, 07:02 AM
#1
Batch file to move files from one folder to another folder excluding some files.
Hi All,
I want to create a batch file which will create a folder first with current date as name of the folder and then move all files from a particular folder of sharedrive to another folder excluding some files. I have got the below code which successfully creates the folder with current date as name of the folder but doesn't move any files. Please help...
@ECHO OFF
SET D=%Date:/=%
SET D=%D:~4,4%
SET D=%D%%Date:~-2%
MD "\\dv\month\%D%"
FOR /f %%a IN ('DIR /b "\\dv\month\date\*.*"') DO (
IF NOT "%%a"=="abc.zip" (
IF NOT "%%a"=="xyz.zip" ECHO MOVE "%%a"
)
)
Thanks a lot for your help in advance.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|