-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathremove_vdms.py
More file actions
25 lines (20 loc) · 764 Bytes
/
remove_vdms.py
File metadata and controls
25 lines (20 loc) · 764 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# Created by https://github.com/realSaddy
import os
import argparse
parser = argparse.ArgumentParser(description="Remove all .vdm files from a directory, by https://github.com/realSaddy")
parser.add_argument("folder", type=str, help="The directory in which to remove the .vdms")
args = parser.parse_args()
if os.path.exists(args.folder):
results = [x for x in os.listdir(args.folder) if x.endswith('.vdm')]
sc = 0
ec = 0
for result in results:
try:
os.remove(args.folder+"/"+result)
sc += 1
except Exception as e:
print("ERROR removing "+result+" | "+e)
ec += 1
print("Removed "+str(sc)+" .vdm files with "+str(ec)+" errors!")
else:
print("ERROR: Folder doesn't exist!")