copy a file to windows home folder

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
gerard
Posts: 72
Joined: 01 Apr 2020, 13:14
Location: Buenos Aires
Contact:

copy a file to windows home folder

Post by gerard » 11 May 2021, 10:37

Hello community. Greetings to all.
I wanted to add the possibility for a script to start with the system, however fileCopy does not copy direct access to the system folder% AppData% \ Microsoft \ Windows \ Start Menu \ Programs \ Startup
I suppose it will be some kind of lockdown for security. Is there a way to make a script start with the system from code?
I know I can create a scheduled task to start with the system, but I find it a bit invasive to do it this way. Otherwise, the user will have to do it manually.

Thanks.
If my tarzan english is not understood, let's blame google translate
User avatar
boiler
Posts: 16973
Joined: 21 Dec 2014, 02:44

Re: copy a file to windows home folder

Post by boiler » 11 May 2021, 10:48

Are you sure it's a security issue and not a problem with your code? I'm able to copy files to that directory using the script below:

Code: Select all

FileCopy, PathyToMyShortcut.lnk, %AppData%\Microsoft\Windows\Start Menu\Programs\Startup

Can you show your script? The way you showed it with spaces before AppData and between all the backslashes wouldn't work. Perhaps you intended to force an expression since you put a space after the first %. If so, then it would be like this:

Code: Select all

FileCopy, PathyToMyShortcut.lnk, % AppData "\Microsoft\Windows\Start Menu\Programs\Startup"
Post Reply

Return to “Ask for Help (v1)”