I'm trying to change the following batch file from this:
if not exist "C:\Program Files (x86)\Microsoft Office\Office14\MSACCESS.EXE" (
) else (
if not exist "%UserProfile%\My Documents\FEO_TRANSFER\DBS" md "%UserProfile%\My Documents\FEO_TRANSFER\DBS"
xcopy \\fkpdfs05\i\SD\FEO_TRANSFER\DBS\%SourceDB% "%UserProfile%\My Documents\FEO_TRANSFER\DBS\" /d /y
start MSACCESS "%UserProfile%\My Documents\FEO_TRANSFER\DBS\%SourceDB%"
and grab a registry value shown in this website:
Instead of hardcoding the path of the batchfile I want to set the variable whatever is in for value:
I tried this:
FOR /F "usebackq tokens=3*" %%A IN (`REG QUERY "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths
\MSACCESS.EXE\Path" /v ValueName`) DO (
set appdir=%%A %%B
But the error I get is system was unable to find the specified registry key or value.
Please note attachment A. Attachment B is provided to show that path actually does exist.
I believe currently I don't have the correct syntax - thus please help!