Home > Software design >  How can i call resgen in a bat file if the file is edited?
How can i call resgen in a bat file if the file is edited?

Time:11-12

I need to create a resource file using resgen.exe only if the file is edited. I've found a way to do it, and i need to loop through all the Language available.

This is my script.

@echo on

echo ------------------------------
echo -- Starting a run of resgen --
echo ------------------------------

Set resourcesPath=%~1Resources\
Set configuration=%~2
Set platform=%~3

set landingPath=%~1bin\%configuration%\Resources\

echo %landingPath%

IF exist %landingPath% ( echo %landingPath% exists ) ELSE ( mkdir %landingPath% && echo %landingPath% created)

set obj[0].Resource="%landingPath%Strings.en-GB.resources"
set obj[0].Text="%resourcesPath%Strings.en-GB.txt"
set obj[1].Resource="%landingPath%Strings.ru-RU.resources"
set obj[1].Text="%resourcesPath%Strings.ru-RU.txt"
set obj[2].Resource="%landingPath%Strings.es-ES.resources"
set obj[2].Text="%resourcesPath%Strings.es-ES.txt"


FOR /L %%i IN (0 1 2) DO  (

    for %%x in ("%%obj[%%i].Text%%") do set date_of_filenameTxt=%%~tx
    for %%x in ("%%obj[%%i].Resource%%") do set date_of_filenameRes=%%~tx

    ECHO            
  • Related