Is %PROGRAMDATA% the same in all versions of Windows?

I need to execute a script every time that Windows boots.
I copied my script to the folder: %PROGRAMDATA%\Microsoft\Windows\Start Menu\Programs\Startup
It works for my computer, but now I'm worried that it could not work for all versions of Windows.
Can someone tell me if this path is always the same?

Any tip will be very helpful, Thanks.

1

2 Answers

This path is the same from windows 7 and up.

I'm not entirely sure if it also works on XP and earlier though, because there the Program Data folder is not C:\ProgramData, but C:\Documents and Settings\All Users\Application Data\ and I don't know from which version of windows they started setting the environmental variables. I think from 2000, but not sure.

EDIT: Just checked, in windows 2000 the %ProgramData% does not exists. Its safe to assume it doesn't in XP either.

However, for backwards compatibility, In windows 7, 8 and 10 the following path (through symlinks) still works: C:\Documents and Settings\All Users\Application Data>

2

%PROGRAMDATA% was new to Windows as of Vista. On Windows XP, it was the Local Settings folder of the All Users profile. There is no All Users profile anymore. The Local AppData for all users has been moved to \ProgramData, and the All Users document folders have been moved to Users\Public.

Also beginning in Vista, Microsoft maintained the \Users\All Users profile directory, but the folders in it are NTFS symbolic links to the places where Microsoft moved them.

As long as your script will never run on XP or earlier, it should be fine. Note that you need to keep using the environment variable, since it does not always refer to C:\ProgramData (although it does in 99.99% of cases).

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like