Set custom folder icon for a network folder in Windows File Explorer

11

4

I access a Windows share and the 'folder icon' section (the bottom one) is missing in its settings. It shows up properly in local folders. I would like to have it with both.

A folder properties window with the icon setting highlighted

A local folder properties window

user89272

Posted 2013-12-09T00:18:09.103

Reputation:

Answers

12

You'll want to use a desktop.ini file to customize the icon. Usually, that's all your actually doing when you are using that "Change Icon" button above. For full documentation see: How to customize folders with desktop.ini An example desktop.ini file follows:

[DeleteOnCopy]
Owner=MyUser
Personalized=13
PersonalizedName=My Folder
[.ShellClassInfo]
InfoTip=@Shell32.dll,-12689
IconFile=%SystemRoot%\system32\shell32.dll
IconIndex=-237

As an aside, if you want to do this without having to manually create the desktop.ini, you can create a folder locally, apply the desired settings, and steal its desktop.ini. (If you don't see it, copy over the entire folder; it should have a correct name originally.) The youtube video Apply a Icon to a Folder on a Network Drive shows this process but uses folder moves rather than creating a new folder.

ssnobody

Posted 2013-12-09T00:18:09.103

Reputation: 2 510

1Here's a more detailed list of desktop.ini options – Tobias Kienzler – 2014-09-24T09:37:27.500

1Is it possible, that this is not working for SMB-shares which is hosted on Linux computer? I setup the desktop.ini on my windows computer and try to see the file tree in windows. My desktop.ini is not hidden and I dont see my custom icon :( – – Michael Walter – 2014-12-23T19:49:20.447

Is it possible your desktop.ini actually has another hidden extension appended that is causing it to not be used? I don't believe windows is sensitive to where the folder is being hosted, whether via native Windows CIFS or via Samba CIFS/SMB. – ssnobody – 2015-01-08T23:32:08.060

1There are several gotchas.  The directory must have the "read-only" attribute set; the desktop.ini must have "hidden" and "system".  I don't know how that can be done in Linux.  Also, the desktop.ini file must be Unicode-encoded.  This probably won't happen if you create the file with *nix tools like vi. – G-Man Says 'Reinstate Monica' – 2015-04-11T16:57:21.470

1Note you also need to set the containing folder to read-only (or system), e.g. via attrib +r or attrib +s. – Tobias Kienzler – 2015-12-23T07:41:05.423

In Linux using Samba you can use the map hidden , map system, and map readonly and you can also store dos attributes if you'd rather have dos style attributes that aren't tied to POSIX file permissions. – ssnobody – 2016-01-13T01:07:44.767

2

The customization method outlined by ssnobody assumes you have the capability to change the folder on the remote machine, and that you want the appearance to be changed for all remote and local users of the folder. If either of these is not true, you might want to use this alternative: create a local shortcut to the remote folder (e.g. right-click drag it to the local desktop and select "create shortcut"), and then use the normal "change icon" button of the properties dialog to change the shortcut's icon.

mgkrebbs

Posted 2013-12-09T00:18:09.103

Reputation: 266

1

A work-around is to rename your image file "folder.jpg" and place in the shared folder.

Anyone with access and using any of the "icon" or "tile" views in Explorer will see it.

BIll R

Posted 2013-12-09T00:18:09.103

Reputation: 11

Please read the question again carefully. Your answer does not answer the original question. This does not change the folder icon. – DavidPostill – 2015-12-12T00:32:25.587

1

It has been a long time since I have seen so much bull :)

  1. Right-click --> Properties --> Customize ---> Change icon is not available on SMB shares.

  2. ... ---> Change picture has no effect.

  3. Desktop.ini is NOT processed by windows for SMB shares, because Linux interprets the (folder's) "Read Only" bit differently, and reports it back to Windows incorrectly:

    • In Linux, Read only means Read only !
    • In Windows, Read only (with folders only) means process Desktop.ini !!!
  4. There is supposed to be a registry setting that forces Desktop.ini processing by using the "System" (super-hidden) flag instead of "Read Only" but I have never gotten it to work as expected.

  5. The lack of desktop.ini processing on SMB breaks many other things, not just folder icons: Symbolic links and personalized name spaces also don't function. The bums at Microsoft are just refusing to deal with it, all the way back to Windows NT.

  6. It is of course always possible to create indirect links to access the SMB folders, and give those custom icons instead, but that causes multiple other problems:

    • Short-cut links are evaluated and cached by default in Windows whenyou open the parent folder, causing "massive" delays in explorer if a folder contains shortcuts to slow or sleeping network shares.
    • Shortcuts in windows are absolute, not relative ergo not portable. This creates a lot of maintenance should the target root path change. Windows also has a habit of automatically converting environment vars to absolute links, defeating any attempt at working around this.
    • Their bird-brained "Distributed Link Tracking Client" service screws things up even further.
  7. The best way to implement relative links in Windows is to use VBS script. In native (text) form, the VBS script will not have a custom icon, but you can assign a custom icon to the EXE file if you compile it.

That is a lot of work though, and the script will create "untrusted" warning messages every time you launch it from a network, unless the script is local or you find a way to sign it.

VBS Relative Link example:
============================
'  This is a VB Script, which emulates a RELATIVE file link/shortcut in Win XP
'
'  1) The first  line declares an untyped variable      ==> objshell
'
'  2) The second line instantiates a new object derived from    ==> Shell.Application
'
'  3) The third  line invokes the object's method       ==> ShellExecute
'
'     with the following parametters:   "target path"
'                                       "target's arguments"
'                   "starting directory"
'                   "action verb"
'                                       Initial window mode:  0 = Hidden Window
'                                                             1 = Normal Window
'                                                             2 = Minimized
'                                                             3 = Maximized
'                                                             4 = Most recent size and position, keep active window active
'                                                             5 = Current size and position
'                                                             6 = 
'                                                             7 = Minimized, keep active window active
'                                10 = Default state specified by target application
'
'  4) The last line frees/destroys the shell object
'
'
dim objShell
set objShell = CreateObject("Shell.Application")
objShell.ShellExecute                                 _
  "..\..\..\SomePath_Three_Dirs_UP_etc"              ,_
  ""                                                 ,_
  ""                                                 ,_
  "open"                                             ,_
  1
set objShell = nothing
===============================================================

Guest

Posted 2013-12-09T00:18:09.103

Reputation: 11

There are options to samba which influence how Linux reports the "read-only" attribute to Windows and which allow Desktop.ini to be processed by windows for SMB shares – ssnobody – 2016-01-13T01:09:39.503

0

Create a icons folder e.g. C:\Icons on Server (you can hide folder from properties if you don't want to see it). Put your .ico files in that folder. Customize your shared folders on Server. Now copy your .ico files to C:\Icons but in your PC client (as duplicate). Now you'll see Network Share icons on both PC (server and client). If you can't access the Server, you can only create shortcuts on the Client and change their icons.

user425154

Posted 2013-12-09T00:18:09.103

Reputation:

This is hard to understand and suspicious.  What do you mean by "Customize your folders on Network PC."?  The OP says he can't.  Do you mean that he has to login directly to the machine that's sharing the drive?  Also, putting stuff in the root directory is not recommended. – G-Man Says 'Reinstate Monica' – 2015-04-11T08:36:52.993

Sure, you have to access the network machine if you want to customize folders icons. – None – 2015-04-11T10:16:11.767

Once you did it, copy all your ico files to another pc (in the same path, eg. c:\icons) and you'll see your network share icons on both machines. – None – 2015-04-11T10:18:11.680

(1) If you’re saying that the user must login directly to the “network machine”, then I suggest that you should have *said* “You must login directly to the remote machine (file server).”  Permission to use a share on a server does not necessarily imply permission/ability to login directly to it.  (And, IMHO, “network PC” is poor terminology.)  (2) I still recommend against putting things in the root directory.  \Users\Public\Documents or the equivalent is probably better.  And even that is necessary only if you want to use icons that aren’t already on the file server. – G-Man Says 'Reinstate Monica' – 2015-04-11T16:41:28.253

Ok, but the user wanted to know how to customize icons on \server\share; the answer is you have to access the server; and if you don't put the same icons in the same path on your machine, you will never see those icons (except on the server). Then we can discuss on everything else... terminology, directories, etc. I wanted to do the same thing and that is the only way :) – None – 2015-04-12T14:47:50.380

Edited answer as suggested (terminology was ambiguous) :) – None – 2015-04-12T14:57:03.400