Image

Image

Search This Blog

Thursday, April 03, 2014

Modify ANZIOLITE.DEF

@echo off
echo (c) 2014 sorin@xxxxxxxx.com

setlocal enableextensions enabledelayedexpansion

set anzio15=Anzio15
set anzio16=Anzio16
set anzio17=Anzio17
set tgtfile=ANZIOWIN.DEF

for %%x in ( !anzio15! !anzio16! !anzio17! ) do (
 for %%A IN ( "!programfiles!" "!programfiles(x86)!" ) do (
  set mypath=%%~A\%%x\%tgtfile%
  ::echo mypath is: !mypath!
  if exist "!mypath!" (
   ::echo anziowin found in !mypath!
   %0\..\ssed.exe -e "s/allow-quit=1/allow-quit=0/g" -e "s/prompt-to-save=0/prompt-to-save=2/g" "!mypath!" > "!mypath!.new"
   move /Y "!mypath!" "!mypath!.old"
   move /Y "!mypath!.new" "!mypath!"
   attrib +R "!mypath!"
  )
 )
)

if exist %appdata%\Anzio Lite\%tgtfile% (
 ::echo anziowin found in appdata
 %0\..\ssed.exe -e "s/allow-quit=1/allow-quit=0/g" -e "s/prompt-to-save=0/prompt-to-save=2/g" "%appdata%\Anzio Lite\%tgtfile%" > "%appdata%\Anzio Lite\%tgtfile%.new" 
 move /Y "%appdata%\Anzio Lite\%tgtfile%" "%appdata%\Anzio Lite\%tgtfile%.old"
 move /Y "%appdata%\Anzio Lite\%tgtfile%.new" "%appdata%\Anzio Lite\%tgtfile%"
 attrib +R "%appdata%\Anzio Lite\%tgtfile%"
)

::End
endlocal

No comments:

Post a Comment

Blog Archive