Question Locked

Rename

0 helpful
8 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Hello all i need a file that will rename a exe file with .old at the end for every exe file on the computer, I had a file below as a test for one file, but need it to rename the file to .exe.old without changing the file name ie. test.exe.old, thanks.

@ECHO OFF

ren "C:\Documents and Settings\tm09042\Desktop\test.txt" "test1.txt"

8 replies

by Member 25348569

I'm intrigued why you might want to do it.

This batch file command will rename all of the exe files on the c: drive.

FOR /F "tokens=*" %%i IN ('DIR /B /A-D /S c:\*.exe') DO ren "%%i" "%%~nxi.old"

Use with care!

:)

by wizard-09

It was requested by a friend, I work with, think it just wants to see how it works then it might mod it for something that he needs it for thanks for the information, will use care :)

by oldbaritone

because he renamed all of the EXE's, he'll know why this was not a good idea.

by tobif

Try to search for
"recursive rename dos batch"

And you should find a lot

by tobif

If he tries to rename all exe-files on the drive he has booted from, then something will go wrong before the procedure has finished.

And by that time it may be too late to put things back without external tools.

by oldbaritone

(give 'im enuff rope to hang hisself...)

There's nothing like a determined ID10T...

by tobif

He wanted to do something to his FRIENDs computer.

With such friends, you don't need trojans. :)

This discussion is closed to new replies.