1.

Solve : Rename a filename?

Answer»

For example:
I had a file with the name: ABC 1.?.? (?: numbers)
And hij had a file with the name ABCD

Now I WANT rename the second file. I want to rename ABCD 1.?.?

How to do?ren ABCD ABCD1234That's not what I mean

I have two files:
1) Firefox Setup 2.0.0.5.exe (this can also be Firefox Setup 2.0.0.6.exe, Firefox Setup 2.0.0.7.exe ETC.)
2) Firefox-Silent.exe

I want to rename Firefox-Silent to Firefox-Silent 2.0.0.5 (of 2.0.0.6 if file one is 2.0.0.6 etc.)

Many thanksQuote from: Inferi0r on July 21, 2007, 09:47:10 AM

I want to rename Firefox-Silent to Firefox-Silent 2.0.0.5

So why don't you just do it?

REN Firefox-Silent.exe "Firefox-Silent 2.0.0.5.exe"

You did KNOW that paths/filenames that contain one or more spaces need to be between quotes? Maybe that is why you are having problems?


It's for a program for unattended installations called Silence of the Foxes and used by the MSFN.org community. Its works so: you put your Firefox V2 version in a folder and then your settings, plugins, addons etc. Then you run a batch command (what I've created). After that you have a compact silent Firefox installer for your new windows INSTALLATION. Install it and you have all the right settings and plugins etc. set.

Now the name of the output is just 'Firefox-Silent'. I want to add the right version to this name. But I can't know what version an user import.

Do you understand?

I was thinking on a command LIKE this
Quote
FOR %%a IN (Firefox Setup 2.*.*.*.exe) DO REN "Firefox-Silent.exe" "%%~nxa"

I know this is wrong (you get output: 'firefox'), but I'm not the expert.Tried, tried and tried...and found

Quote
for /f "tokens=3" %%i in ('dir /b /a:-d "Firefox Setup *"') do ren "Firefox-Silent.exe" "Firefox-Silent %%i"


Discussion

No Comment Found