VMware Horizon Community
burgerking68
Enthusiast
Enthusiast
Jump to solution

Folder Redirection with DEM - double entrys in registry

Windows 10 ,1909

DEM 9.9

VMWare Horiozon 7.10

Hello, we are using DEM with Folder Redirection and have recently been faced with the problem that the desktop icons created via batch file are no longer displayed on the desktop. When troubleshooting we came across duplicate entries for the folder redirection folders in the registry. (German version) - the same entries were highlighted in the same color).

Can someone explain to me, or does someone have the same "feature"?

Thank you for the answer!

pastedImage_1.png

pastedImage_3.png

VMWare 8.4, DEM 2106
0 Kudos
1 Solution

Accepted Solutions
DEMdev
VMware Employee
VMware Employee
Jump to solution

Hi burgerking68,

That makes sense: if you redirect the Desktop folder, File Explorer (and any well-written application) no longer looks at the default %UserProfile%\Desktop folder, but only at the redirected location. In the non-working example, I'm sure that Robocopy does indeed copy "TestFolder" correctly – it's just that File Explorer no longer looks at that "physical" location.

One way to solve this, would be to look up the "effective" location of the Desktop folder in the registry. I did a very quick experiment (so please carefully validate in your environment), but the following command seems to do the trick:

FOR /F "tokens=2*" %%A IN ('REG QUERY "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /v Desktop') DO SET DesktopFolder=%%B

Alternatively, you might be able to use DEM's Predefined Settings or Files and Folders feature to put the files on the user's desktop? And maybe even manage them via a personalization config file (possibly in combination with a default predefined setting) in case you want to persist a user's changes? (Which I gather is something you'd like to do, given that /MIR argument in your examples...)

View solution in original post

3 Replies
DEMdev
VMware Employee
VMware Employee
Jump to solution

Hi burgerking68,

Those additional entries are created by DEM (to deal with Windows 10's notion of "local" profile folders), but I can't imagine that they would affect copy operations from a batch file.

How exactly are you creating those desktop items from that batch file, and when does it run?

burgerking68
Enthusiast
Enthusiast
Jump to solution

Hi DEMdev,

as an example, we have created a login script with robocopy. We have noticed in the meantime that the desired folder in the script is not copied when the variable %Userprofile% is used instead of UNC-Path.

The log from Robocopy does not show any errors here - in fact the desired folder "TestFolder" is not copied to the desktop. If we use the absolute UNC path to folder redirection instead of the above, it works.

Here's the example in which it does not work:

robocopy \\<DCName>\NETLOGON\anwendungen\TestFolder %userprofile%\Desktop\TestFolder *.* /MIR


Now the example in which it works.

robocopy \\<DCName>\NETLOGON\anwendungen\TestFolder \\<DCName>\daten$\<DFSRUserFolders>\%username%\Desktop\TestFolder *.* /MIR



Basically, we want to use the batch as part of a logon script under DEM. However, in the mentioned tests we tested it directly in the user context of an active session

Annotation: We work with DFSR for name-resolution...

VMWare 8.4, DEM 2106
0 Kudos
DEMdev
VMware Employee
VMware Employee
Jump to solution

Hi burgerking68,

That makes sense: if you redirect the Desktop folder, File Explorer (and any well-written application) no longer looks at the default %UserProfile%\Desktop folder, but only at the redirected location. In the non-working example, I'm sure that Robocopy does indeed copy "TestFolder" correctly – it's just that File Explorer no longer looks at that "physical" location.

One way to solve this, would be to look up the "effective" location of the Desktop folder in the registry. I did a very quick experiment (so please carefully validate in your environment), but the following command seems to do the trick:

FOR /F "tokens=2*" %%A IN ('REG QUERY "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /v Desktop') DO SET DesktopFolder=%%B

Alternatively, you might be able to use DEM's Predefined Settings or Files and Folders feature to put the files on the user's desktop? And maybe even manage them via a personalization config file (possibly in combination with a default predefined setting) in case you want to persist a user's changes? (Which I gather is something you'd like to do, given that /MIR argument in your examples...)