CMD Datei umbenennen?
Wenn man auf dieser Webseite: https://iconverticons.com/online/ ein Bild konvertiert, steht immer in dem Dateinamen noch der alte Dateityp, z.B.:
Bild.png.ico
Gibt es eine Möglichkeit nur das .png aus dem Dateinamen zu entfernen also das später
Bild.ico
rauskommt?
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.
Ja das war mir klar aber ich möchte gerne das auf alle Dateinamen anwenden können
für Windows gibt es kostenlos das Programm Advanced Renamer. Damit kann man beliebig viele Dateinamen ändern/neu benennen etc.
Gibt es hier: https://www.advancedrenamer.com/
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
}
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