Announcement

Collapse
No announcement yet.

rename from command line

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    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, 07:44 PM. Reason: hm

    #2
    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)

    Comment


      #3
      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, 01: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.

      Comment


        #4
        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.

        Comment


          #5
          @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)

          Comment


            #6
            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.

            Comment

            Working...
            X