1.

Solve : ren help?

Answer»

my files

M:\setup.exe
M:\1\setup.exe
M:\2\setup.exe
M:\2\2\setup.exe

how to rename all the .exe file become .vc use the for command ?
I assume you are running under Windows 2000 / XP / 2003 / Vista? Do you want to rename all .EXE files on the M: drive? Or just all setup.exe files on the M: drive? Or just the files you listed?

To rename all setup.exe files on the M: drive from the command line, try:
Code: [Select]for /f %a in ('dir M:\setup.exe /s /b') do ren %a *.vc
If you want to do this from a batch file, change %a to %%aOr just do:
Code: [Select]ren (your folder)\*.exe *.vcQuote from: Dark Blade on May 10, 2007, 01:52:13 AM

Or just do:
Code: [Select]ren (your folder)\*.exe *.vc

This is fine for the files in (your folder), but not any of the other folders in the example. My solution will rename all files named "setup.exe" in all directories on the drive and all subdirectories, sub-subdirectories, etc. If that is not what you want please be more specific so we can GIVE a better solution.it's work, tq

erm.... can i rename the same size *.exe files?

M:\setup.exe [5mb]
M:\1\setup.exe [5mb]
M:\2\setup.exe [3mb]
M:\3\setup.exe [5mb]
M:\4\setup.exe [4mb]

* can i rename the *exe file if there are same size in "BATCH"? Quote from: insertusername on May 11, 2007, 04:08:04 AM
it's work, tq

erm.... can i rename the same size *.exe files?

M:\setup.exe [5mb]
M:\1\setup.exe [5mb]
M:\2\setup.exe [3mb]
M:\3\setup.exe [5mb]
M:\4\setup.exe [4mb]

* can i rename the *exe file if there are same size in "BATCH"?

Yes.erm... i mean i want it auto rename when the *exe file size is same.

how to write in batch?Same size as what?Quote from: GuruGary on May 11, 2007, 09:09:32 AM
Same size as what?

I was wondering thatis same size on disk.

how i write a .bat to rename .exe file if they are same size on disk? Quote from: insertusername on May 14, 2007, 01:29:18 AM
is same size on disk.

how i write a .bat to rename .exe file if they are same size on disk?

This is like pulling teeth.

Please state as fully as POSSIBLE what you want to do!
Maybe try PROVIDING us with a flow chart, or write the program using words instead of code. Something like:
Quote
Search the entire C: drive for files named setup.exe
Ignore files that are in hidden directories
For any other files that are found, look at the file sizes
If any of them have the same file size as the file C:\setup.exe, then rename all others to setup.vc leaving the C:\setup.exe with the same name
... or whatever you want to do.Is this section of the forum

(1) A free batch file writing service for lazy numpties

-or-

(2) A place where people who are trying to write batch files get helpful hints and pointers? (ideally by providing a FIRST effort to be looked at and commented upon)

I very much want it to be (2).

Yes, (2) would be much better.(1) A free batch file writing service for lazy numpties


i DISLIKE this word! "lazy numpties", nvm i will learn with myself.

guru tq


Discussion

No Comment Found