[Window Title]
Restrictions
[Content]
This operation has been cancelled due to restrictions in effect on this computer. Please contact your system administrator.
[OK]
We encountered this dialog with Citrix XenApp 6.5 sessions when using various programs. The issue is this dialog is generated when a button would open a dialog and the default path was %userprofile% or %temp% or any other path that defaulted and started with C:. The cause of it is a group policy setting. If you disable the viewing of the drive letter that the dialog is trying to default to; this message appears. For us, some programs were trying to default to %TEMP% which is trying to go “C:\Users\myTest\AppData\Local\Temp\1”. Since “C:” is in the path, this dialog was disallowed and the message popped up.
NOTE: This message will only pop up if the program uses the standard Windows dialog. If a program uses a custom dialog it will not receive this message.
To avoid this issue we wanted to default to the users ‘My Documents’ folder, which is redirected and stored on an allowed drive letter. But My Documents isn’t a variable we can utilize. But we can create a script that launches prior to our program launching and create the variable:
::Gets the personal folder location and sets it as a variable
> %TEMP%\personal.ps1 ECHO $var = Get-ItemProperty -Path 'Registry::HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders' -Name Personal
>> %TEMP%\personal.ps1 ECHO $var.personal
for /f "tokens=*" %%A IN ('powershell.exe -executionpolicy bypass -file "%TEMP%\personal.ps1"') DO set MYDOCS=%%A
::Gets the personal folder location and sets it as a variable