CMD Datei umbenennen?

7 Antworten

Mit dem Befehl "REN" kannst du Dateien unbennenen. In deinem Fall musst du "REN Bild.png.ico Bild.ico" in der Kommandozeile eingeben.


TheCreeper2002  02.01.2018, 09:03

@FreeMan562 versuche es mit: ren *.png.ico *.ico

FreeMan562 
Beitragsersteller
 02.01.2018, 03:12

Ja das war mir klar aber ich möchte gerne das auf alle Dateinamen anwenden können

SET myPath=[Laufwerk:\Pfad\Verzeichnis]

FOR /F "tokens=1,2,3 delims=." %%A IN ('dir /b %myPath%\*.ico') DO (
	REN "%%A.%%B.%%C" "%%A.%%C"
)

Copy the script and make it into a txt file, save it under converter.bat without opening it, now move your image onto the icon of the converter, enter the name png.ico in the converter and it should be take a picture in the ico 

If it doesn't work, I couldn't test it because it's a script for Win11 and I have Win 10 on my 2 PC

But I'm pretty sure it works, I just did it myself and actually know what I'm doing

::script by f3|\*::


echo off
color e
title rename
set 1= &1
cls
goto start
{
:start
if exist %1% goto 1
if not exist %1% goto 2
{
    :1
        cls
        powershell Write-Host 'File load' -fo 'green';
        pause
        echo enter the name of the file
        echo to which the file should be renamed
        set /p input=
        ren %1% %input%
        exit 
        {
             :2
        cls
        powershell Write-Host 'couldn't find file' -fo 'red';
        pause
        exit    
        }   
}
    exit
}
Woher ich das weiß:eigene Erfahrung

Felix9321  14.07.2024, 14:06

I'm taking everything back, I put one thing wrong and can't edit it anymore XD

Die Zeile hier sollte dir immer NUR die "vorletzte" Dateiendung entfernen:

for %%F in (*.ico) do for %%n in ("%%~nF") do ren "%%~nxF" "%%~nn%%~xF"

~Tim