|I create invoices via excel and theyre named "FirstName LastName AmoutBilled.xls" and I wanted to add the word "PAID" at the end of the filename. I could do this by just renaming the file manually, but it is a bit too slow when doing a lot of them (and the person who does this isnt very computer savvy), so instead I created a conext action for the .xls file type so when you right click an .xls file there is a PAID action in the menu, and it is linked to the batch file.|
Thats not the issue, the issue is to get the batch file to work properly.
So. Looking around I saw a solution at: http://www.computing.net/answers/pr... and I changed the solution to: FOR /f "tokens=* delims=" %%a in ('dir/b/a-d') do (ren "%%a" "%%~Na PAID%%~Xa") and that worked great, it added PAID to the end of the filename.
However, the issue is that it's changing ALL .xls files within the same directory (due to the 'dir/b/a-d' part I guess), and I only want the file(s) I select to change. Is there a way to obmit the dir part?
For example if I have just a simple REN *.xls PAID.xls in the batch file, it changes just the file I have selected, but obviously doesnt change it the way I want it to with keeping the original file name and adding PAID to the end of the file.
So is there way to get the FOR /f "tokens=* delims=" %%a in ('dir/b/a-d') do (ren "%%a" "%%~Na PAID%%~Xa") code to work with just one file? Or an alternate code?