Announcement

Collapse
No announcement yet.

Expansion of environment variables during runtime

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

    Requested Expansion of environment variables during runtime

    The feature that I'd like to be added is the expansion of custom environment variables in lnk shortcuts during runtime.

    As an example, let's assume we have two image files in following locations:
    Code:
    c:\windows\photo0001.jpg
    g:\prv\photos\photo0002.jpg
    In a separate working dir we have two shortcuts (.lnk) to those images.
    Code:
    c:\shortcuts\photo001.lnk -> Target: %SYSTEMROOT%\photo0001.jpg
    c:\shortcuts\photo002.lnk -> Target: %MYPHOTOSDRIVE%:\prv\photos\photo0002.jpg
    Below is the batch script that sets "MYPHOTOSDRIVE" variable ("SYSTEMROOT" is built into Windows by default) and runs IrfanView with proper parameters. Let's say we have it in the same directory as shortcuts:
    Code:
    c:\shortcuts\script.cmd
    script.cmd code:

    Code:
    @echo off
    if /i "%PROCESSOR_ARCHITECTURE%" equ "AMD64" (
      set IRFANPATH="%ProgramFiles(x86)%\IrfanView\i_view32.exe"
    ) else (
      set IRFANPATH="%ProgramFiles%\IrfanView\i_view32.exe"
    )
    
    set MYPHOTOSDRIVE=%cd:~0,1%
    echo.Photo drive: %MYPHOTOSDRIVE%
    echo.System root: %SYSTEMROOT%
    
    %IRFANPATH% c:\shortcuts\photo001.lnk
    %IRFANPATH% c:\shortcuts\photo002.lnk
    I'd expect that in this case two environment variables from .lnk files would be expanded to their values and two images would be shown, one after another. It would be awesome if it could also apply to slideshows (here source folder contains .lnk files):
    Code:
    %IRFANPATH% /slideshow=c:\shortcuts\
    Would it be possible to include such enhancement in IrfanView?

    Thank you for your time!
    Last edited by mesiek; 06.02.2012, 01:06 PM.

    #2
    Irfanview does not resolve shortcuts.
    If an application asks the system to resolve the link then the systems also replaces variables.
    There is nothing special you should do with the final filename in this case.

    Comment

    Working...
    X