Search found 3 matches

by josh24
28 Dec 2014 17:30
Forum: DOS Batch Forum
Topic: Renaming folders that contain exclamation marks
Replies: 6
Views: 6692

Re: Renaming folders that contain exclamation marks

Should be no more than 1 asterisk, so that'll do, Thanks.
by josh24
28 Dec 2014 14:37
Forum: DOS Batch Forum
Topic: Renaming folders that contain exclamation marks
Replies: 6
Views: 6692

Re: Renaming folders that contain exclamation marks

Thanks Yury, it works perfectly. The first line of filename.txt might have a vertical bar or an asterisk in it. Since these characters aren't allowed in folder names, I'm trying to remove them from the string before I rename the folder. Yury's solution removes the vertical bar, but asterisks still p...
by josh24
28 Dec 2014 11:41
Forum: DOS Batch Forum
Topic: Renaming folders that contain exclamation marks
Replies: 6
Views: 6692

Renaming folders that contain exclamation marks

Very new to batch files in general. I'm trying to rename a list folders to the first line of a .txt file within the corresponding folder. setlocal enabledelayedexpansion for /D %%f in (*) do ( set /p str=< %%f\filename.txt set str=!str:^|=! echo.!str! rename "%%f" "!str!") pause ...