Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Copying file to Startup folder for All Users

I am trying to write a batch file that will copy itself to the startup folder in Windows 7 for all users.

I have tried this code here:

copy test.bat "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup" 

and it does notwork. However, if I input this code instead:

copy test.bat "C:\Users\Kreature\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup" 

it works but the problem is that I need this to be universal for all accounts.

like image 531
user222586 Avatar asked Dec 13 '25 06:12

user222586


1 Answers

I guess that you must call the script from an admin account in order to copy a file to the system folders. Try "Execute as administrator" on CMD and call your script.

like image 175
user3407000 Avatar answered Dec 15 '25 05:12

user3407000



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!