Jump to content
Strawberry Orange Banana Lime Leaf Slate Sky Blueberry Grape Watermelon Chocolate Marble
Strawberry Orange Banana Lime Leaf Slate Sky Blueberry Grape Watermelon Chocolate Marble

MSFN is made available via donations, subscriptions and advertising revenue. The use of ad-blocking software hurts the site. Please disable ad-blocking software or set an exception for MSFN. Alternatively, register and become a site sponsor/subscriber and ads will be disabled automatically. 



jpeachman

Member
  • Content count

    2
  • Donations

    $0.00 
  • Joined

  • Last visited

Community Reputation

0 Neutral

About jpeachman

  1. 7z SFX Modified Module and Tools

    Excellent point about there being no need to set a variable! I confess I haven't written any AutoIT scripts and was just attempting a pretty literal translation of the original into a batch file. I didn't write the FOR loop so nicely, either. It can easily be done with a single iteration, and everything can go on one line with unwanted output suppressed too by using: @FOR /F "tokens=3 skip=4" %%a IN ('REG QUERY "HKCU\Control Panel\International" /v sLanguage') DO @IF "%%a"=="FRA" START /WAIT HS62001_LangFR.exe Yzöwl's example of piping through FIND is still slightly shorter than this, though. Where using FOR rather than FIND might be shorter and more straightforward is if you were testing for more than one condition. For a three-language example: @FOR /F "tokens=3 skip=4" %%a IN ('REG QUERY "HKCU\Control Panel\International" /v sLanguage') DO @IF "%%a"=="FRA" (START /WAIT HS62001_LangFR.exe) ELSE IF "%%a"=="DEU" (START /WAIT HS62001_LangDE.exe) ELSE IF "%%a"=="ENU" (START /WAIT HS62001_LangEN.exe)It's probably good to know both techniques; still, Yzöwl's method is shortest for the specific need expressed by coucou!
  2. 7z SFX Modified Module and Tools

    Try: FOR /F "tokens=2*" %%a in ('REG QUERY "HKCU\Control Panel\International" /v sLanguage') DO @(SET Lang=%%b) IF "%Lang%"=="FRA" START /WAIT HS62001_LangFR.exe SET Lang=
×