How to prevent duplicate endings

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
Online
Native2904
Posts: 77
Joined: 23 Apr 2025 18:48
Location: Aachen

How to prevent duplicate endings

Post by Native2904 »

I often download icons to create useful CTBs, which usually come in *.png format. I tried to create a button that allows me to convert a selected file directly into an *.ico file. For this, I want to use the command line options of IrfanView. Unfortunately, I don’t know how to prevent the newly created file from ending up with a duplicate extension.

I checked the help section, but due to my lack of in-depth knowledge I couldn’t find anything relevant. Can anyone point out what I’m doing wrong?

Code: Select all

run """C:\Users\Home\Apps\IrfanView\i_view64.exe"" ""<curitem>"" /resize=(256,256) /convert=""<curitem>.ico""";
I have the feeling I’ve read about this somewhere before, but I can’t remember where. :roll:
Edit:Typo
Lts. 64-bit XY-Port. ƒ Cascadia Code @ Windows 11 Pro 24H2 ▣ 1920x1080 ⇵ 115%
Glückauf

admin
Site Admin
Posts: 65515
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: How to prevent duplicate endings

Post by admin »

Instead of <curitem>.ico try <curpath>\<curbase>.ico

Online
Native2904
Posts: 77
Joined: 23 Apr 2025 18:48
Location: Aachen

Re: How to prevent duplicate endings

Post by Native2904 »

Thank you and Merry Christmas.
Lts. 64-bit XY-Port. ƒ Cascadia Code @ Windows 11 Pro 24H2 ▣ 1920x1080 ⇵ 115%
Glückauf

WirlyWirly
Posts: 307
Joined: 21 Oct 2020 23:33
Location: XY 64-Bit | Win 10 @ 100% (3440x1440)

Re: How to prevent duplicate endings

Post by WirlyWirly »

I use IrfanView myself, but I never thought to check for command line options. Neat!

I did something similar using ImageMagick and python, but as a loop so that it would work on multiple items at once.

Highend went and re-wrote it using XYScript, so you don't even need python. I use it all the time, very handy.

viewtopic.php?p=193338#p193338

Online
Native2904
Posts: 77
Joined: 23 Apr 2025 18:48
Location: Aachen

Re: How to prevent duplicate endings

Post by Native2904 »

2 WirlyWirly

Thank you!
I can add command-line parameters on my own, but when it comes to scripting, that’s where the wheat separates from the chaff. I’m trying to teach myself computer skills — or rather, how to manage files on a computer.
If I had to put it in the words of a five-year-old, I’d say: “You developers are my superheroes.” :ninja:
Thanks also for the script.
Lts. 64-bit XY-Port. ƒ Cascadia Code @ Windows 11 Pro 24H2 ▣ 1920x1080 ⇵ 115%
Glückauf

Post Reply