This is what I have, but not working:
@echo off
setlocal enabledelayedexpansion
for /f %%F in ('dir /b c:\Documents and Settings\username) do (
set newname=%%~nF
set newname=!newname:~0,-8!.pdf
)
Thanks for any help with this.
Need help with your computer or device? Want to learn new tech skills? You're in the right place!
Geeks to Go is a friendly community of tech experts who can solve any problem you have. Just create a free account and post your question. Our volunteers will reply quickly and guide you through the steps. Don't let tech troubles stop you. Join Geeks to Go now and get the support you need!
D:\Temp\work>dir
Volume in drive D is D370_D
Volume Serial Number is 9402-7174
Directory of D:\Temp\work
03/01/2013 09:01 PM <DIR> .
03/01/2013 09:01 PM <DIR> ..
03/01/2013 08:55 PM 0 filename1_12345.pdf
03/01/2013 08:55 PM 0 filename2_12346.pdf
03/01/2013 08:55 PM 0 filename3_12347.pdf
3 File(s) 0 bytes
2 Dir(s) 61,983,436,800 bytes free
D:\Temp\work>ren filename*_*.pdf filename*_.pdf
D:\Temp\work>dir
Volume in drive D is D370_D
Volume Serial Number is 9402-7174
Directory of D:\Temp\work
03/01/2013 09:02 PM <DIR> .
03/01/2013 09:02 PM <DIR> ..
03/01/2013 08:55 PM 0 filename1_.pdf
03/01/2013 08:55 PM 0 filename2_.pdf
03/01/2013 08:55 PM 0 filename3_.pdf
3 File(s) 0 bytes
2 Dir(s) 61,983,436,800 bytes free
D:\Temp\work>
0 members, 0 guests, 0 anonymous users
Community Forum Software by IP.Board
Licensed to: Geeks to Go, Inc.