Answer the question
In order to leave comments, you need to log in
What program to use under Windows to delete files according to the list?
I need a program that accepts a file with a list of files. Then she deletes files according to this list. At the same time, it supports shared disks and those mounted using the net command.
Here is what I expect from her in pseudocode:
def read_file_list(filename):
result = None
with open(filename, encoding='UTF-8') as f:
result = f.readlines()
return result
def remove_files(filenames):
for path in filenames:
filename = path[:-1]
try:
os.remove(filename)
except FileNotFoundError as e:
print('Not found: {}'.format(filename), file=sys.stderr)
def main(argv=None):
file_list = sys.argv[1]
files = read_file_list(file_list)
remove_files(files)
Answer the question
In order to leave comments, you need to log in
If Windows, then PowerShell. A very powerful scripting language, more than meets your needs.
You can try Deletist*
www.ghacks.net/2010/08/04/deletist-bulk-delete-fol...
Well, the PS command seems to work, and it is not a script (it may require some additional keys in some cases, like -recursive), although the potential problems for users when working with PS are clear:
Get-Content c:\path\to\list.txt | Remove-Item
DISCLAIMER: did not check the subject for performance, incl. in the mentioned TS use-case.
BAT, Powershell. Why do you need some separate program, if all this is easily implemented using the built-in Windows command shells?
Another non-answer to your question. The program is unknown to me. The script can be quickly thrown on the wonderful AutoIt. It compiles to exe and it is not necessary to specify your own copyrights. We can say that Uncle Vasya developed. I can be this Uncle Vasya myself, as a last resort. :)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question