1

Using Group Policy Object > User > Preferences > Windows Settings > Files I can copy a file to user desktop using a target file name like this: %USERPROFILE%\Desktop\targetfile.txt.

Now I'm trying to do similar task, using Group Policy > Computer > Preferences > Windows Settings > File.

What shortcut should I use instead %USERPROFILE%\Desktop\ to do it right way?

2 Answers 2

2

The correct environmental variable is %DesktopDir% for the current user, and %CommonDesktopDir% for all users. Group policy environmental variables are different than the standard environmental variables. You can see a list of all of them by pressing F3 in any text field:

Group Policy Environmental Variable Dialog Box

1
  • Great tip. That's I was looking for. What a shame that F3 key isn't indicated anywhere.
    – huhu78
    Nov 16, 2015 at 9:55
1

There is common desktop that you can use to populate files, shortcuts, etc for all users. Change your target to C:\Users\Public\Desktop.

Unfortunately, the only all userprofile variable is %allusersprofile% in my environment it points to c:\programdata which is not useful.

3
  • OK, this should be safe for standard installation of Windows 7/8/10. All of them have got C:\Users\Public\Desktop. And maybe it's enough for 99% of cases.
    – huhu78
    Nov 13, 2015 at 15:15
  • Please mark as answer to help others find there is a solution.
    – Joel T
    Nov 13, 2015 at 17:50
  • You could also use Item Level Targeting to prevent those other 1% cases. You might also look at %public%\Desktop
    – Nixphoe
    Nov 13, 2015 at 18:04

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .