Results 1 to 6 of 6

Thread: rename from command line

  1. #1
    IV Newbie
    Join Date
    Feb 2007
    Posts
    3

    Default rename from command line

    i need rename and convert files from command line. Now i can to only convert. May be add in next version Irfan rename function in command line?

    after some time i found "Available placeholders for file/image properties:" and creat lnk file with "i_view32.exe vfw-0.bmp /jpgq=75 /convert=$T(%Y-%m-%d %H_%M_%S).jpg"

    interesting fact, this commad work at shortcut but not correct work in bat file. Windows XP sp3
    Last edited by Denn; 30.08.2009 at 06:44 PM. Reason: hm

  2. #2
    Power User Foxy's Avatar
    Join Date
    Aug 2007
    Posts
    819
    Version
    IrfanView 4.25
    OS
    32-bit Win XP Pro SP3

    Default

    Within a batchfile you must use a special notation (%%):

    i_view32.exe vfw-0.bmp /jpgq=75 /convert=$T(%%Y-%%m-%%d %%H_%%M_%%S).jpg
    »Und so, in eurer Verzweiflung, kommt ihr zu mir.«

    Texteditor EmEditor:
    Deutsche Sprachdatei (v7.01) für EmEditor Pro 7.02 (englisch)
    EmEditor Pro 8.06 (deutsch) | Deutsche Sprachdatei (v8) für EmEditor Pro 8.06 (englisch)
    Deutsche Sprachdatei (v9.16) für EmEditor Pro 9.17 (englisch)

  3. #3
    Multiple User ChuckE's Avatar
    Join Date
    Jul 2006
    Location
    Arizona
    Posts
    289
    Version
    IrfanView 4.37
    OS
    64-bit Win 7 Professional SP1
    CPU Cores
    8

    Default

    Quote Originally Posted by Denn View Post
    interesting fact, this commad work at shortcut but not correct work in bat file. Windows XP sp3
    I don't believe that to be true, at least not true with the limited info you stated.

    Why don't you tell us what exact command, the exact syntax, you tried within a batch file, so we can look over to see where you might have been led astray. Usually it is the misplacement of quotes (IE. ") , OR like Foxy said, the forgetting of the "%%" in batch files, that get people into trouble. (Nice avatar Foxy )

    Note: you can use the forum syntax [code]place your batch text here[/code] to get this:
    Code:
    place your batch text here
    Last edited by ChuckE; 31.08.2009 at 12:31 AM.
    I wish to die peacefully in my sleep, like my grandfather.
    Not like those passengers, in his car, when he drove over that cliff.

  4. #4
    IV Newbie
    Join Date
    Feb 2007
    Posts
    3

    Default

    Quote Originally Posted by Foxy View Post
    Within a batchfile you must use a special notation (%%)
    oh thanks, this is what I need. I completely forgot this rule.

  5. #5
    Power User Foxy's Avatar
    Join Date
    Aug 2007
    Posts
    819
    Version
    IrfanView 4.25
    OS
    32-bit Win XP Pro SP3

    Cool

    @Denn

    If you want to rename all image files within a directory under usage the pattern ”%Y-%m-%d %H_%M_%S.*”, you can apply the following batch script:


    @echo off
    cls

    set iview=C:\IrfanView\i_view32.exe
    set source=C:\Bilder\
    set infofile=%Temp%\info.txt

    for %%a in (%source%*.*) do call :INFO "%%a"
    goto :END

    :INFO
    "%iview%" %1 /info="%infofile%"

    for /F "tokens=4,5,6,8,9,10 delims=.: " %%a in ('type "%infofile%" ^| find.exe /i "File date"') do (
    (set day=%%a) & (set month=%%b) & (set year=%%c) & (set hour=%%d) & (set minute=%%e) & (set second=%%f)
    )

    for %%a in (%1) do ren "%source%%%~na%%~xa" "%year%-%month%-%day% %hour%_%minute%_%second%%%~xa"
    goto :EOF

    :END
    if exist "%infofile%" del "%infofile%"
    set iview=
    set source=
    set infofile=
    set day=
    set month=
    set year=
    set hour=
    set minute=
    set second=



    @ChuckE
    (Nice avatar Foxy)
    Very nice.
    »Und so, in eurer Verzweiflung, kommt ihr zu mir.«

    Texteditor EmEditor:
    Deutsche Sprachdatei (v7.01) für EmEditor Pro 7.02 (englisch)
    EmEditor Pro 8.06 (deutsch) | Deutsche Sprachdatei (v8) für EmEditor Pro 8.06 (englisch)
    Deutsche Sprachdatei (v9.16) für EmEditor Pro 9.17 (englisch)

  6. #6
    Multiple User ChuckE's Avatar
    Join Date
    Jul 2006
    Location
    Arizona
    Posts
    289
    Version
    IrfanView 4.37
    OS
    64-bit Win 7 Professional SP1
    CPU Cores
    8

    Default

    Denn, is there some reason you want to use a Batch file, and not the batching features of IrfanView?


    ________________________
    Foxy, Aber Sie wissen nicht, was ich komme für.
    I wish to die peacefully in my sleep, like my grandfather.
    Not like those passengers, in his car, when he drove over that cliff.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •