Click here to Skip to main content
16,019,768 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all,

I'm trying to use batch file as command to move file from current folder to another folder. From what I search in Internet, I've found a way to move all file in folder or all same extension in a folder. But I'm not found the way to move anything in folder but with exception file.

For example, let's say in a folder, I have 20 *.txt file, 15 *.dll file, 30 *.pdf file, 2 *.exe file and 1 *.ini file..so I have an options to:

move D:\MyFolder\*


OR

move D:\MyFolder\*.txt
move D:\MyFolder\*.dll
move D:\MyFolder\*.pdf
move D:\MyFolder\*.exe


Case here is I want to use move D:\MyFolder\* but I don't want to move the .ini file which means it will move all the content except *.ini file. Could someone tell me how to complete this?
Posted
Updated 6-Aug-12 19:08pm
v2
Comments
Sergey Alexandrovich Kryukov 6-Aug-12 23:29pm    
Do you really mean DOS? MS-DOS, PC-DOS? :-)
--SA
Sergey Alexandrovich Kryukov 6-Aug-12 23:31pm    
This is a combination of FOR loop with IF.
--SA

1 solution

You can use wildcards (regex patters etc) to move particular files.
This thread[^] might answer your query.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900