However, I am facing a problem when trying to get the path of the All Users Desktop folder. My program should be able to run on a variety of Windows OS ranging from Windows Server 2003 to Windows 7. As far as I know, the location of All Users Desktop in Vista or above is as follows:
And the location in XP or below is as follows:
"C:\\Documents and Settings\\All Users\\Desktop\\"
Of course I can hard code my program, but I'm looking for a way to acquire the path using some C# method or something similar so as to eliminate obvious possible errors of those paths being changed by users. What can I do?
Thank you finito. However, my problem is not actually how to create a Desktop shortcut - that I can do. What I need is a way to retriew the path of the All Users Desktop programmatically without having to hard code it. I also need my program to be able to run on a variety of Windows OS from Windows Server 2003 to Windows 7.