Discussion forum for all Windows batch related topics.
Moderator: DosItHelp
-
mr_ale
- Posts: 1
- Joined: 11 Nov 2013 14:03
#1
Post
by mr_ale » 11 Nov 2013 14:11
Hello everyone, I'm new to the forum and I write from Italy with google translator

Can you tell me how to write a program that would allow me to delete all files in a directory except one? every time I start It, program delete all files except one automatically. is it possible?
thank you!
-
foxidrive
- Expert
- Posts: 6031
- Joined: 10 Feb 2012 02:20
#2
Post
by foxidrive » 11 Nov 2013 15:43
Welcome to the forum.
Code: Select all
attrib +h "file to keep.txt"
del "c:\folder\*.*?"
attrib -h "file to keep.txt"