1
I want to make an app, that is located on %localappdata% folder (in a subforlder of it), to run on Windows startup, when it is installed for the user.
I am able to do that if I create a string value under the key HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run
and set it to C:\Users\my_user\AppData\Local\programs\My_App\My_App.exe" --app_id=12346
.
However, I don't want to put a direct reference to my user in it. So I've tried to, instead of putting C:\Users\my_user\AppData\Local
, to use %localappdata%
in the String value, so it looks like %localappdata%\programs\My_App\My_App.exe" --app_id=12346
.
However, using the Local App Data reference doesn't work - the app doesn't launch. I wonder if there is a way of using a reference to %LocalAppData% inside a registry key - maybe I have a syntax error?
Could you help me with it?
I've already thought of creating a bat file to call my app, and put it into C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup
, but it would run for all users, and I cannot guarantee all users will have my app installed. So that wouldn't be a good choice.