Passing Variables in Batch File

Mar 5, 2013 at 11:04 PM
I am having an issue with the program not modifying the files from within a batch file. Here is my batch file (within the square brackets), with the fnr.exe command at the end:

@ECHO off
SET /p BUILD=What EQUIP version is being installed?
SET /p DRIVE=What Drive is the Auto-IT folder located on (C,D,E,etc)?

IF NOT EXIST %DRIVE%:\%BUILD%Download\Reg_Key_Backup (
ECHO Creating registry backup directory...
mkdir %DRIVE%:\%BUILD%Download\Reg_Key_Backup


IF EXIST %DRIVE%:\%BUILD%Download\Reg_Key_Backup (
ECHO Backing up DBProfiles.reg
reg export "HKLM\SOFTWARE\Wow6432Node\Auto-I.T. Pty Ltd\Units\2.0\Database Profiles" %DRIVE%:\%BUILD%Download\Reg_Key_Backup\DBProfiles.reg
ECHO Backing up ODBCINI.reg
reg export "HKLM\SOFTWARE\Wow6432Node\ODBC\ODBC.INI" %DRIVE%:\%BUILD%Download\Reg_Key_Backup\ODBCINI.reg


cd /D %DRIVE%:\%BUILD%Download\Reg_Key_Backup
copy DBProfiles.reg "%DRIVE%:\%BUILD%Download\Build_%BUILD%\AppSupport\DealerSettings\Support\DealerProfile.reg"
copy ODBCINI.reg "%DRIVE%:\%BUILD%Download\Build_%BUILD%\AppSupport\DealerSettings\Support\DealerODBC.reg"

"%DRIVE%:\%BUILD%Download\fnr.exe" --cl --dir "%DRIVE%:\%BUILD%Download\Build_%BUILD%\AppSupport\DealerSettings\Support" --fileMask "Dealer*.reg" --excludeFileMask ".dll, .exe" --caseSensitive --find "\Wow6432Node\" --replace "\"



Outside of the batch file, it works great. So my questions is, does using fnr.exe within a batch file pass the set variables to the command. I have looked at this for several days now and don't see a problem.

Any help would be appreciated.

Jun 18, 2013 at 10:48 PM
Edited Jun 18, 2013 at 11:03 PM
I had the same issue. Add an extra backslash at the end of the find text (e.g. "\Wow6432Node\\"). It is just the last one that causes the issue. You may have to do the same for the replace clause.