I have a few files I want to rename automatically using data found in the file. Basically it is a ton of invoices I have scanned. I want to find the keyword "invoice: " then grab the next 10 characters that follow that keyword and rename the file with those 10 characters.
So if I have a file named abc.txt with invoice: 1234567890 in it, it will then be renamed 1234567890.txt
Scripting Languages
Last Comment
realParker
8/22/2022 - Mon
Shift-3
Paste the script below into a text file with a .vbs extension. Customize the value of the strFile variable with the location of the text file to be renamed. Running the script will rename the file based on the invoice number.
That is just the ticket... almost. Is there a way to add a wild card or tell it to do an entire folder full of file rather than one at a time? I have about 500 files and it will be almost the same amount of work to change the strFile variable as to just change the file name myself.
Open in new window