3

Just noticed something as I was playing around with the Startup folder of the Default user in both Windows 8.1 and Windows 10: For some reason, on all of my installs of Windows 10, the Default user's startup folder does not exist where it should be, C:\Users\Default\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup, whereas in Windows 8.1 it exists.

I've seen on the web that it apparently was replaced with C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp starting in Win7, but I have this path in Win8.1 but not Win10. Win10 goes up to the Programs folder, then Startup doesn't exist.

If I manually create the Startup folder in C:\Users\Default\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\ and deposit something in it, will the OS run it at start or not ?

Because in this case, I cannot use the Startup folder in ProgramData, because the .BAT file will self-delete after usage, but it needs to be ran on every new user's first logon. By putting it in C:\Users\Default\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup, it would simply copy over to the user's own Startup folder during the user's profile creation, run, and then delete itself.

If manually creating the startup folder does not work, is there an easy way to do what I need to do ? The only other way I've found would be to start the batch file with an IF statement to search whether the result of the batch file exists or not (which is a registry key) and if so then not run, but that means that everytime the user logs on, the batch file will start, which isn't ideal.

Thanks in advance!

1 Answers1

0

Although it does not exist by default, C:\Users\Default\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup is a valid path if you create it manually.

Files placed in here will be copied into other user's StartUp folder when they first log in. If the user has already logged in before and therefore already has a user folder then this won't have any affect until the user profile is removed.

For your self-deleting .bat file, this seems like your best option. I've tested it myself today on Windows 10 Enterprise 21H2.

In contrast, the same startup for the public folder does not work, i.e C:\Users\Public\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup.

Instead, as helpful comments mentioned C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp is made available in Windows 10 and up. As well as synchronising across all users this folder requires admin rights to modify.

If you went with this option, you could add a check to your script to see if it had run for a user beforehand, e.g. you could create a hidden file in a user's AppData and then check if it exists before running the script.

This isn't really relevant to your specific use-case, but the Task Manager startup list also exists now, this answer documents how you can add programs to it yourself by adding a String Value inside the registry HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run.

By the same logic, you could also add it to the default user registry HKEY_USERS\.DEFAULT\Software\Microsoft\Windows\CurrentVersion\Run.

Baa
  • 531
  • 4
  • 9