I want to change a registry value (a REG_DWORD), then run an application, by using a batch file, that is located in the same folder as the application. I tried the lines below, but that does not work:
reg add "HKEY_CURRENT_USER\A User Name\An Application Name" /v A value name_h3981298716 /d "99" /t REG_DWORD /f
START %~dp0AnApplicationName.exe
The "START ..." will work without the "reg add ..." code. The batch file can run an application, but it cannot change a registry value of REG_DWORD type.
How to do the sequence below correctly with a batch file?
First, change a registry value of REG_DWORD type.
Then run an application.
%~dp0AnApplicationName.exewith double quotes. Whenever a batch file "does not work" place as many usefulechoes in there and start it using a command prompt. With that you can check at what point the file failed.