Hi, I'm trying to get a copy of my application to the launch folder.
However, although I did not get an error, my code block does not work and my file is not copied.
I would be happy if you could help.
- static void ExeCopy()
- {
- if (!File.Exists(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + @"\Microsoft\Windows\Start Menu\Programs\Startup\securpass.exe"))
- {
- File.Copy(Path.GetFileName(Application.ExecutablePath), Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + @"\Microsoft\Windows\Start Menu\Programs\Startup\securpass.exe");
- }
- }
Furkan KaragullePosted Dec 5, 2020, 2:30 PM
element to:Sachin SinghPosted Dec 3, 2020, 9:53 AM
- The srcPath:- means the path to your File .
- DestinationPath:- means the path where you want to copy your File.
Now , simply find the path where your exe file resides. and deside a folder where you want to copy your exe file.Furkan KaragullePosted Dec 3, 2020, 8:00 AM
Amit GuptaPosted Dec 2, 2020, 9:41 PM
Amit GuptaPosted Dec 2, 2020, 9:35 PM
Amit GuptaPosted Dec 2, 2020, 5:32 AM
Sachin SinghPosted Dec 1, 2020, 10:46 PM