How can I make a Click-once deployed app run a startup?
The best option I found by searching was to set the Publisher on the app to Startup, so the Start menu shortc
First off thanks for the answer Discdev. To get this to work with Å Ä Ö and other special characters this modification did it for me, using UTF-8 a different code page and no BOM.
string[] mystrings = new string[] { "chcp 65001", @"IF EXIST ""%appdata%\Microsoft\Windows\Start Menu\Programs\\.appref-ms"" (""%appdata%\Microsoft\Windows\Start Menu\Programs\\.appref-ms"") ELSE (start /b """" cmd /c del ""%~f0""&exit /b)" };
string fullPath = "%appdata%\\Microsoft\\Windows\\Start Menu\\Programs\\Startup\\StartErrandDynamicMenu.bat";
System.Text.Encoding utf8WithoutBOM = new System.Text.UTF8Encoding(false);
System.IO.File.WriteAllLines(Environment.ExpandEnvironmentVariables(fullPath), mystrings, utf8WithoutBOM);