@echo off cd /d "%APPDATA%\Processing" set infile=preferences.old set outfile=preferences.txt taskkill /F /IM javaw.exe /T echo Check the existence of the preferences.txt if exist %outfile% ( echo The prefereces.txt exists. ) else ( echo The prefereces.txt does not exists. echo Make the file. call "C:\App\processing\processing.exe" taskkill /F /IM javaw.exe /T ) move %outfile% %infile% type %infile% | ^ find /v "proxy.host=" | ^ find /v "proxy.port=" | ^ find /v "proxy.http.host=" | ^ find /v "proxy.http.port=" | ^ find /v "proxy.https.host=" | ^ find /v "proxy.https.port=" > %outfile% echo proxy.host=192.168.177.160>> %outfile% echo proxy.http.host=192.168.177.160>> %outfile% echo proxy.http.port=3128>> %outfile% echo proxy.https.host=192.168.177.160>> %outfile% echo proxy.https.port=3128>> %outfile% echo proxy.port=3128>> %outfile%