• We should now be fully online following an overnight outage. Apologies for any inconvenience, we do not expect there to be any further issues.

Dos Batch File Renaming

Net

Golden Member
Aug 30, 2003
1,592
3
81
Hello,

I have a group of files that are named as such (word can be any word or numbers):

Word word-word word word Floor B2342 Word Word-word.pdf
Word word-word word Floor: B-2342 Word Word-word.pdf
Word word- Floor C43 Word Word.pdf
Word word word- Floor- E2AD342 Word Word.pdf

I want to rename everything in the folder to only have the group that follows Floor... You can count on Floor always being in the file name and what I want to keep following floor.

B2342.pdf
B-2342.pdf
C43.pdf
E2AD342.pdf

A one liner would be nice but it can be more since it will be in a .bat file. The main concern is being robust.
 

Net

Golden Member
Aug 30, 2003
1,592
3
81
thanks for the input but this is for a friend that isn't allowed to install/run unapproved programs on the computer.
 
Last edited:

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
The rename command built into cmd supports wildcards to an extend, but I don't think it'll do what you want. I'm fairly certain you'll need a 3rd party tool or a custom script, probably done in VBScript since cmd's batch syntax is fucking terrible.
 

Net

Golden Member
Aug 30, 2003
1,592
3
81
Vbscript is fine. Anything that can run on a default install of vista without installing anything. Ill look at vbscript, if you know how that would be good too. Thanks.
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
Vbscript is fine. Anything that can run on a default install of vista without installing anything. Ill look at vbscript, if you know how that would be good too. Thanks.

I wouldn't call it good, but it's the best of bad choices.