Search found 8 matches

by jmi
06 Jan 2014 09:52
Forum: DOS Batch Forum
Topic: Rename with a batch file - but only the files ending with *D
Replies: 13
Views: 4412

Re: Rename with a batch file - but only the files ending wit

I just needed to add the end bracket: @echo off pushd "C:\temp\TEST\IN\" setlocal enabledelayedexpansion for /f "delims=" %%a in ('dir "*D.txt" /b /a-d ') do ( set "name=%%~na" set "name=!name:~0,-1!I" ren "%%a" "!name!%%~xa") pop...
by jmi
06 Jan 2014 09:50
Forum: DOS Batch Forum
Topic: Rename with a batch file - but only the files ending with *D
Replies: 13
Views: 4412

Re: Rename with a batch file - but only the files ending wit

PERFECT foxidrive!!! HERO of the day ;)
Thank you very very much! Your last post did the job!
by jmi
06 Jan 2014 09:39
Forum: DOS Batch Forum
Topic: Rename with a batch file - but only the files ending with *D
Replies: 13
Views: 4412

Re: Rename with a batch file - but only the files ending wit

The file-names look like this:
20131009-17-02-01200278D.txt
or
20131009-17-02-01200278.txt
But never contain letters, only numbers or a D at the end...
by jmi
06 Jan 2014 09:35
Forum: DOS Batch Forum
Topic: Rename with a batch file - but only the files ending with *D
Replies: 13
Views: 4412

Re: Rename with a batch file - but only the files ending wit

No, there will be no other D in the filename.
by jmi
06 Jan 2014 09:25
Forum: DOS Batch Forum
Topic: Rename with a batch file - but only the files ending with *D
Replies: 13
Views: 4412

Re: Rename with a batch file - but only the files ending wit

No, only the last one, the one infront of the .txt
by jmi
06 Jan 2014 09:18
Forum: DOS Batch Forum
Topic: Rename with a batch file - but only the files ending with *D
Replies: 13
Views: 4412

Re: Rename with a batch file - but only the files ending wit

Thank you foxidrive!
This does rename it with adding a "I" correctly to the files with a D at the end.
But how can I REPLACE the D?

1234D.txt --> 1234I.txt (D gets replaced by I)
1234X.txt --> 1234X.txt (stays the same)

THANK YOU :)
by jmi
06 Jan 2014 09:14
Forum: DOS Batch Forum
Topic: Rename with a batch file - but only the files ending with *D
Replies: 13
Views: 4412

Re: Rename with a batch file - but only the files ending wit

Thank you foxidrive!
This does rename it with adding a "I" correctly to the files with a D at the end.
How can I REPLACE the D

1234D.txt --> 1234I.txt (D gets replaced by I)
1234X.txt --> 1234X.txt (stays the same)

THANK YOU :)
by jmi
06 Jan 2014 08:05
Forum: DOS Batch Forum
Topic: Rename with a batch file - but only the files ending with *D
Replies: 13
Views: 4412

Rename with a batch file - but only the files ending with *D

Hi I want to rename all the files in the directory "C:\temp\TEST\IN\" but only txt-files that end with a "D". Here is what I tried in a batch... but both didn't work. Help highly appreciated -----try1----- @echo off set Quelle="C:\temp\TEST\IN\" Set DateiFilter="*D...