Univention Bugzilla – Bug 41375
Change default icon of desktop folder "Eigene Shares" via netlogon script
Last modified: 2017-08-30 18:53:15 CEST
Code snippet from customer that creates an desktop.ini file within the "Eigene Shares" directory for overriding the folder's default icon. This makes it more noticable to the students/teachers. ---[cut]--- Const DESKTOP = &H10& Const FolderName = "Eigene Shares" Const HIDDEN = 2 CONST SYSTEM = 4 Set objShell = CreateObject("Shell.Application") Set objFolder = objShell.Namespace(DESKTOP) Set objFolderItem = objFolder.Self Set FileSysObj = WScript.CreateObject("Scripting.FileSystemObject") FolderPath = objFolderItem.Path + "" + FolderName DesktopIniPath = FolderPath + "" + "desktop.ini" If (FileSysObj.FileExists(DesktopIniPath)) Then FileSysObj.DeleteFile DesktopIniPath, True End If Set DesktopIniFile = FileSysObj.CreateTextFile(DesktopIniPath, True, True) DesktopIniFile.WriteLine "[.ShellClassInfo]" DesktopIniFile.WriteLine "InfoTip=Meine Freigaben im Netzwerk" DesktopIniFile.WriteLine "IconResource=%SystemRoot%system32\imageres.dll,-143" DesktopIniFile.Close Set objFile = FileSysObj.GetFile(DesktopIniPath) objFile.Attributes = objFile.Attributes OR HIDDEN Set objFile = FileSysObj.GetFolder(FolderPath) objFile.Attributes = objFile.Attributes OR SYSTEM ---[cut]---
Other requirements are: * Better, customizable names for links to file shares, e.g. "Home-Verzeichnisse Schüler" instead of home_schueler * Icon for "Meine Dateien" is the user icon * Icon for other shares is the group icon * The desktop.ini file should be hidden by default
Slightly deviating from our discussion, I would suggest the following: 1) The .ini file is always written. 2) The value of the "IconResource=" entry should be configurable via UCR variables; if the UCR variable is not set, no IconResource entry is written to the file. 3) The UCR variable will only be set (to e.g. "%SystemRoot%system32\imageres.dll,-143") if the UCR variable is unset and starting with UCS@school 4.2 → Please create a new bug for this UCS@school 4.2 change. 4) The name and InfoTip is also configurable via UCR but uses the current values as fallback. → there should be no change in behaviour if the U@S 4.1 R2 v10 update is installed.
Just got the hint from the customer, that the "InfoTip" entry does not work most probably.
(In reply to Sönke Schwardt-Krummrich from comment #2) > 3) The UCR variable will only be set (to e.g. > "%SystemRoot%system32\imageres.dll,-143") if the UCR variable is unset and > starting with UCS@school 4.2 → Please create a new bug for this UCS@school > 4.2 change. We should consider recreating the logon scripts with the update to UCS@school 4.2 to activate this new feature for all users.
r77127: advisory and code to set the icons. New UCRVs: * ucsschool/userlogon/shares_folder_icon- default unset * ucsschool/userlogon/my_files_link_icon- default unset * ucsschool/userlogon/other_links_icon- default unset * ucsschool/userlogon/my_files_link_name - default "Eigenen Dateien" If the *_icon UCRVs are set, icons will be set for the folders and links. Links are not configured with desktop.ini, but when creating. ucr set \ ucsschool/userlogon/shares_folder_icon='%SystemRoot%\system32\imageres.dll,143' \ ucsschool/userlogon/my_files_link_icon='%SystemRoot%\system32\imageres.dll,207' \ ucsschool/userlogon/other_links_icon='%SystemRoot%\system32\imageres.dll,193' Then the UCRVs are unset, the script will not change the icons.
(In reply to Daniel Tröder from comment #5) > r77127: advisory and code to set the icons. New UCRVs: > * ucsschool/userlogon/shares_folder_icon- default unset > * ucsschool/userlogon/my_files_link_icon- default unset > * ucsschool/userlogon/other_links_icon- default unset > * ucsschool/userlogon/my_files_link_name - default "Eigenen Dateien" ucsschool/userlogon/my_files_link_name defaults to "Meine Dateien" > If the *_icon UCRVs are set, icons will be set for the folders and links. > Links are not configured with desktop.ini, but when creating. OK > ucr set \ > ucsschool/userlogon/shares_folder_icon='%SystemRoot%\system32\imageres.dll, > 143' \ > ucsschool/userlogon/my_files_link_icon='%SystemRoot%\system32\imageres.dll, > 207' \ > ucsschool/userlogon/other_links_icon='%SystemRoot%\system32\imageres.dll,193' OK > Then the UCRVs are unset, the script will not change the icons. → OK OK: code change OK: functional test UPDATED: YAML
UCS@school 4.1 R2 v10 has been released. http://docs.software-univention.de/changelog-ucsschool-4.1R2v10-de.html If this error occurs again, please clone this bug.