在Windows 2008上设置强制configuration文件时,文件关联不会停留

我目前有3个用户在我的Windows 2008远程桌面服务器上使用强制configuration文件。 我设法通过更改registry权限,设置configuration文件文件夹的权限以及在使用.man扩展名locking之前设置初始用户的configuration文件,从而使所有事情都能够很好地发挥作用。 我的问题涉及远程桌面上的关联。

通常我会做以下…

1) Get all three users to log out 2) Change the profile from .man to .dat 3) Get the "profile template user" (a title I have given the first user I set up with the profile for) to log on. 4) Get that user to create a shortcut or set up a file association, etc. 5) Get that user to log off. 6) Rename the profile from .dat to .man 

出于某种原因,除了文件关联之外,我的所有更改似乎都从用户到用户。 我不能得到那个坚持的东西!

想法?

当用户login时,我最终创build了一个用于组策略的registry文件。 在这种情况下,我在下面的例子中说明了如何在registry中使用环境variables。

这有点棘手但很容易做到。 这个例子将允许您用驻留在用户特定目录中的程序(Notepad ++)打开某种types的文件(* .test)。 我在运行远程桌面(AKAterminal服务器)的Windows 2008服务器上使用这种scheme,以允许每个用户使用安装PER用户帐户的程序,以便每个用户可以使用不同的设置(例如:* .ini文件位于apps目录)。 注意:这并不重要,但文件夹“程序”是隐藏的,所以用户看不到它。

 Paths: Application (notepad++): Y:\%username%\programs\Notepad++\notepad++.exe File To Open (File.test): Y:\%username%\TestFiles\File.test 

步骤1.如果使用强制configuration文件,请确保将NTUSER.MAN文件更改回NTUSER.DAT。

第2步。使用远程桌面客户端login到您想要编辑的configuration文件。

第3步。打开registry编辑器并删除以下键(如果存在)。

HKEY_CURRENT_USER \ Software \ Classes \ Applications \ notepad ++。exe HKEY_CURRENT_USER \ Software \ Microsoft \ Windows \ CurrentVersion \ Explorer \ FileExts.test

第4步。创build一个新的文本文件并将其命名为“original.reg”。 填写以下内容…

 Windows Registry Editor Version 5.00 [HKEY_CURRENT_USER\Software\Classes\Applications\notepad++.exe] [HKEY_CURRENT_USER\Software\Classes\Applications\notepad++.exe\shell] [HKEY_CURRENT_USER\Software\Classes\Applications\notepad++.exe\shell\open] [HKEY_CURRENT_USER\Software\Classes\Applications\notepad++.exe\shell\open\command] @="" 

第5步。刷新registry(F5)并查找新密钥。 应该看到“(默认)”值为空白的“命令”键。 在“命令”键中添加一个名为“New Value#1”的新“可扩展string值”。 将值设置为应用程序path“Y:\%username%\ programs \ Notepad ++ \ notepad ++。exe”“%1” 。 然后将“命令”键作为“expanded.reg”导出到桌面。

第6步。编辑记事本中的“expanded.reg”文件,并复制“新值#1”后的所有数据。 例如:=hex(2):22 …

 Windows Registry Editor Version 5.00 [HKEY_CURRENT_USER\Software\Classes\Applications\notepad++.exe\shell\open\command] @="" "New Value #1"=hex(2):22,00,59,00,3a,00,5c,00,25,00,75,00,73,00,65,00,72,00,6e,00,\ 61,00,6d,00,65,00,25,00,5c,00,70,00,72,00,6f,00,67,00,72,00,61,00,6d,00,73,\ 00,5c,00,4e,00,6f,00,74,00,65,00,70,00,61,00,64,00,2b,00,2b,00,5c,00,6e,00,\ 6f,00,74,00,65,00,70,00,61,00,64,00,2b,00,2b,00,2e,00,65,00,78,00,65,00,22,\ 00,20,00,22,00,25,00,31,00,22,00,00,00 

第7步。closuresexpanded.reg文件并打开“original.reg”文件,然后用我们剪贴板中的新hex值replace默认命令(即空“”)。 文件“original.reg”现在应该如下所示:

 Windows Registry Editor Version 5.00 [HKEY_CURRENT_USER\Software\Classes\Applications\notepad++.exe] [HKEY_CURRENT_USER\Software\Classes\Applications\notepad++.exe\shell] [HKEY_CURRENT_USER\Software\Classes\Applications\notepad++.exe\shell\open] [HKEY_CURRENT_USER\Software\Classes\Applications\notepad++.exe\shell\open\command] @=hex(2):22,00,59,00,3a,00,5c,00,25,00,75,00,73,00,65,00,72,00,6e,00,\ 61,00,6d,00,65,00,25,00,5c,00,70,00,72,00,6f,00,67,00,72,00,61,00,6d,00,73,\ 00,5c,00,4e,00,6f,00,74,00,65,00,70,00,61,00,64,00,2b,00,2b,00,5c,00,6e,00,\ 6f,00,74,00,65,00,70,00,61,00,64,00,2b,00,2b,00,2e,00,65,00,78,00,65,00,22,\ 00,20,00,22,00,25,00,31,00,22,00,00,00 

第8步。现在我们已经准备好了扩展variables,只需添加一个扩展来与应用程序关联即可。 将以下内容添加到“original.reg”文件,使其看起来像以下内容…

 Windows Registry Editor Version 5.00 [HKEY_CURRENT_USER\Software\Classes\Applications\notepad++.exe] [HKEY_CURRENT_USER\Software\Classes\Applications\notepad++.exe\shell] [HKEY_CURRENT_USER\Software\Classes\Applications\notepad++.exe\shell\open] [HKEY_CURRENT_USER\Software\Classes\Applications\notepad++.exe\shell\open\command] @=hex(2):22,00,59,00,3a,00,5c,00,25,00,75,00,73,00,65,00,72,00,6e,00,\ 61,00,6d,00,65,00,25,00,5c,00,70,00,72,00,6f,00,67,00,72,00,61,00,6d,00,73,\ 00,5c,00,4e,00,6f,00,74,00,65,00,70,00,61,00,64,00,2b,00,2b,00,5c,00,6e,00,\ 6f,00,74,00,65,00,70,00,61,00,64,00,2b,00,2b,00,2e,00,65,00,78,00,65,00,22,\ 00,20,00,22,00,25,00,31,00,22,00,00,00 [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.test] [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.test\OpenWithList] "a"="notepad++.exe" "MRUList"="a" [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.test\OpenWithProgids] "Notepad++_file"=hex(0): [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.test\UserChoice] "Progid"="Applications\\notepad++.exe" 

第9步。打开registry编辑器并删除以下键(如果存在)。 (是的,再次)…现在的registry就像我们从来没有做任何事情,我们有一个registry文件准备插入registry!

HKEY_CURRENT_USER \ Software \ Classes \ Applications \ notepad ++。exe HKEY_CURRENT_USER \ Software \ Microsoft \ Windows \ CurrentVersion \ Explorer \ FileExts.test

第10步。如果你想应用到当前的configuration文件,然后运行registry文件“original.reg”,并将其插入到registry中。

而就是这样! 现在所有的* .test文件将打开“Y:\%username%\ programs \ Notepad ++ \ notepad ++。exe”。 去检查registry,看看新的默认条目。