Alan's Blog

"Yeah. I wrote a script that will do that."

Menu
  • About My Blog
Menu

Set Share Folder Icon for Server 2012 and Windows 10

Posted on February 5, 2017 by Alan

I like to look at a folder and know whether or not it is shared. In earlier Windows OS there was a hand overlay which shows you this information. In Server 2012, this indicator has been omitted. Set-SharedFolderIcons.ps1 lets you use the icon of your choosing to restore this hint that a folder is shared.   There is a bit at the bottom of the script which you may edit:

#You can edit these values
$dllFile = "c:\windows\system32\imageres.dll"
$iconIndex = 169
$btest = $false

#if False, will not be prompted for folder choice
$bConfirmIconChoice = $true
#End Edits

The icon is generated with the Icon Extractor, and is used to preview your choice like this:

Confirm Icon Dialog

The script will enumerate shares, skipping admin shares, and, on a domain controller, it skips Sysvol and NetLogon shares.  The list goes to Out-Gridview, and selected shares get the new icon by editing the desktop.ini file.

Script Text

 

Leave a Reply

You must be logged in to post a comment.

Search

Please Note

All the scripts are saved as .txt files. Newer files have a “View Script” button which will let you save or open a script in notepad. For earlier posts, the easiest way to download with IE is to right click on the link and use “Save Target As”. Rename file from Name_ext.txt to Name.ext.

To see a full post after searching, please click on the title.

PowerShell Scripts were written with version 3 or later.

https connections are supported.

All new users accounts must be approved, as are comments. Please be patient.  If you find a post error or a script which doesn’t work as expected, I appreciate being notified.  My email is my first name at the domain name, and you are welcome to contact me that way.

Tags

1E ACLS Active Directory ActiveDirectory ADSI Advanced Functions Audit Change Administrator Password COMObject Computer Groups DateTime Desktop DNS Excel FileScriptingObject Forms General GPO GPS Group Policy Hacks ISE Lockout logons NAV740 Nessus OU OU permissions Outlook Pick Folder Power PowerShell Powershell Scriptlets RDP SCCM schedule reboot Scripting Security Shell.Application user information VBA Windows Update WMI WordPress WPF

Categories

akaplan.com

  • Back to Home Page

Archives

Scripting Sites

  • A Big Pile of Small Things
  • Adam, the Automator
  • Art of the DBA
  • Ashley McGlone
  • Boe Prox
  • Carlo Mancini
  • DexterPOSH
  • Doug Finke
  • Jaap Brasser's Blog
  • JeffOps The Scripting Dutchman
  • Jonathan Medd's Blog
  • Keith Hill's Blog
  • LazyWinAdmin
  • Nana Lakshmanan
  • PowerShell Magazine
  • PowerShell Team Blog
  • PowerShell.org
  • PwrShell.net
  • Richard Siddaway's Blog
  • Ryan Yates' Blog
  • Skatterbrainz
  • The Lonely Administrator

SQL Site

  • Art of the DBA

Meta

  • Register
  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org
©2025 Alan's Blog | Theme by SuperbThemes

Terms and Conditions - Privacy Policy