Search found 47 matches
- 31 Jan 2024 17:33
- Forum: DOS Batch Forum
- Topic: Batch File To Create Folder With Current Date
- Replies: 14
- Views: 50750
Re: Batch File To Create Folder With Current Date
Ok thank you for confirming that. It must be a connection lag issue with the network drive then.
- 31 Jan 2024 12:40
- Forum: DOS Batch Forum
- Topic: Batch File To Create Folder With Current Date
- Replies: 14
- Views: 50750
Re: Batch File To Create Folder With Current Date
Hi Batcher. I been using the code you wrote for a while now and it works really well so thank you for that. However, sometimes I am noticing that I am having trouble deleting files in the folders that your code auto creates on a network drive. I am just trying to figure out if the network drive secu...
- 09 Jan 2024 19:56
- Forum: DOS Batch Forum
- Topic: Batch File To Change Date Format In Filename
- Replies: 7
- Views: 16246
Re: Batch File To Change Date Format In Filename
Thank you very much. It's working great except I had some dates that were already formatted correctly and those got messed up. Is there a way you could add a feature that if the date is already in YYYY.MM.DD format, just leave it alone? If not, no worries. I will just make a note in the code to be ...
- 04 Jan 2024 12:07
- Forum: DOS Batch Forum
- Topic: Batch File To Change Date Format In Filename
- Replies: 7
- Views: 16246
Re: Batch File To Change Date Format In Filename
Thank you very much. It's working great except I had some dates that were already formatted correctly and those got messed up. Is there a way you could add a feature that if the date is already in YYYY.MM.DD format, just leave it alone? If not, no worries. I will just make a note in the code to be c...
- 03 Jan 2024 14:20
- Forum: DOS Batch Forum
- Topic: Batch File To Change Date Format In Filename
- Replies: 7
- Views: 16246
Batch File To Change Date Format In Filename
I have PDF files that have dates in the file name. I would like to keep the exact date for each of these files but change the format of the date. Couple examples for how the filenames are read: AB TALLY 01.01.24.pdf (date is mm.dd.yy) AB ABCDEFG 12.25.23.pdf (date is mm.dd.yy) I would like it to cha...
- 19 Dec 2023 19:16
- Forum: DOS Batch Forum
- Topic: Batch file to replace - with . in file name
- Replies: 6
- Views: 24195
Re: Batch file to replace - with . in file name
Thanks Squashman for pointing that out. I found that post and tried it myself with this code: @echo off cd /d "%~dp0" for /f "delims=" %%i in ('dir /b /s /a-d *-*.pdf') do ( set "OldFile=%%i" set "OldName=%%~nxi" setlocal enabledelayedexpansion set NewName=!OldName:-=.! ren "!OldFile!" "!NewName!" e...
- 19 Dec 2023 16:57
- Forum: DOS Batch Forum
- Topic: Replace Word In Filename With Another Word
- Replies: 3
- Views: 10846
Re: Replace Word In Filename With Another Word
For reference of what I would like the result to be:
Original File Name
ABC - Deposit 07-05-23.pdf
New File Name:
ABC TALLY 07.05.23.pdf
Original File Name
ABC - Deposit 07-05-23.pdf
New File Name:
ABC TALLY 07.05.23.pdf
- 19 Dec 2023 16:00
- Forum: DOS Batch Forum
- Topic: Replace Word In Filename With Another Word
- Replies: 3
- Views: 10846
Replace Word In Filename With Another Word
I have a ton of PDF files in a folder. It is named in this format: ABC - Deposit 07-05-23.pdf I would like a batch file to replace the "- Deposit" with "TALLY" instead. If possible, I would also like the date format to be replaced from MM/DD/YY.pdf to MM.DD.YY.pdf. So basically remove the dashes in ...
- 04 Dec 2023 13:28
- Forum: DOS Batch Forum
- Topic: Batch file to replace - with . in file name
- Replies: 6
- Views: 24195
Batch file to replace - with . in file name
Anyone know how to make a batch file to replace all dashes (-) in a file name with periods (.)? I basically have a ton of PDF files that are named like this: HN TALLY 11-18-23.pdf HN TALLY 11-19-23.pdf REG 11-20-23.pdf EW CAR 11-21-23.pdf and so on.... I would like it to rename the files like this i...
- 30 Nov 2023 18:28
- Forum: DOS Batch Forum
- Topic: Batch File To Remove Word In Filename
- Replies: 2
- Views: 17754
Re: Batch File To Remove Word In Filename
Thank you so much for the help. Works great!
- 29 Nov 2023 16:43
- Forum: DOS Batch Forum
- Topic: Batch File To Remove Word In Filename
- Replies: 2
- Views: 17754
Batch File To Remove Word In Filename
I have a bunch of PDF files in a folder and they are all named like this: Tally Cash Date 11.29.23.pdf I would like to just remove the words "Cash" and "Date" in the file name so they all show like this: Tally 11.29.23.pdf Does anyone know how to make a batch file that can do this? I looked online a...
- 09 Nov 2023 15:29
- Forum: DOS Batch Forum
- Topic: Batch File To Create Folder With Current Date
- Replies: 14
- Views: 50750
Re: Batch File To Create Folder With Current Date
test-2.bat @echo off set "YourLocation=C:\Test" for /f %%i in ('powershell "Get-Date -uformat '%%Y%%m%%d'"') do ( set "Today=%%i" ) set "Today=%Today:~4,2%-%Today:~6,2%-%Today:~0,4%" echo,%Today% md "%YourLocation%\%Today%" pause Thanks. I figured it out for the date format. Is there a way to chang...
- 09 Nov 2023 15:21
- Forum: DOS Batch Forum
- Topic: Batch File To Create Folder With Current Date
- Replies: 14
- Views: 50750
Re: Batch File To Create Folder With Current Date
test-2.bat @echo off set "YourLocation=C:\Test" for /f %%i in ('powershell "Get-Date -uformat '%%Y%%m%%d'"') do ( set "Today=%%i" ) set "Today=%Today:~4,2%-%Today:~6,2%-%Today:~0,4%" echo,%Today% md "%YourLocation%\%Today%" pause Ok never mind. I got it to work but I was wondering, how do I change ...
- 09 Nov 2023 14:15
- Forum: DOS Batch Forum
- Topic: Batch File To Create Folder With Current Date
- Replies: 14
- Views: 50750
Re: Batch File To Create Folder With Current Date
test-2.bat @echo off set "YourLocation=C:\Test" for /f %%i in ('powershell "Get-Date -uformat '%%Y%%m%%d'"') do ( set "Today=%%i" ) set "Today=%Today:~4,2%-%Today:~6,2%-%Today:~0,4%" echo,%Today% md "%YourLocation%\%Today%" pause When I try these out, the "YourLocation=C:\Test" which is what I past...
- 16 Oct 2023 19:05
- Forum: DOS Batch Forum
- Topic: Batch File To Create Folder With Current Date
- Replies: 14
- Views: 50750
Re: Batch File To Create Folder With Current Date
Thanks for the reply and suggestion. I have a directory established already and the folders are all in MM-DD-YYYY format so I kind of want to keep it that way. I do see the benefit of making it YYYY-MM-DD if I had multiple folders with different years mixed together but I am going to keep it all sep...