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?

huhu78
  • 151
  • 1
  • 1
  • 7

2 Answers2

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

tfrederick74656
  • 1,452
  • 1
  • 13
  • 29
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.

Joel T
  • 59
  • 1
  • 2
  • 7
  • 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 '15 at 15:15
  • You could also use `Item Level Targeting` to prevent those other 1% cases. You might also look at `%public%\Desktop` – Nixphoe Nov 13 '15 at 18:04
  • Please mark as answer to help others find there is a solution. – Joel T Nov 13 '15 at 17:50