Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am working on learning Powershell and have been trying to write a script that will automatically map my drives to specific network drives. That's easy enough, but I also want certain names associated with them from Windows Explorer. This can be done from the registry, but I can't figure out how to do it from Powershell. I researched online and I can navigate the registry like a normal drive up to a certain point now, using gci and set-location/cd, but once I am to the last folder key, I can't see the DWORDs inside the key using gci anymore. From regedit, I know there are a bunch of keys inside. My path is HKCU:\software\microsoft\windows\currentversion\explorer\mountpoints2##ComputerName#DriveName

share|improve this question
You confuse the term "key" with the value(s) and their associated data contained in the key. In powershell, the values are considered to be "properties" of the key. Subkeys of the key are "childitems". Keys are containers, values are not. – kreemoweet Aug 14 '13 at 19:17
up vote 5 down vote accepted

Simple; use the command get-itemProperty to see all the keys. So, if you've followed the path as far as you've got in your question, the command to see everything associated is:

get-itemproperty .\

You can obviously also see this from higher in the directory structure, just add the path after the .\

To accomplish your task of renaming the drive labels so they show up in Windows explorer, use the following:

set-itemProperty . _LabelFromDesktopINI "insert new label here"
share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .