Share via


PowerShell cannot find path to HKLM "because it does not exist

Question

Wednesday, December 22, 2010 3:32 PM

Trying to learn PowerShell, watching old TechNet video intro to PS. Came to Navigating the Registry. I tried the command: Set-Location HKLM

Set-Location : Cannot find path 'C:\Users\nnnn\HKLM' because it does not exist. (Where nnnn = my profile). This is on a Windows7 machine.

tmb

All replies (3)

Wednesday, December 22, 2010 4:07 PM ✅Answered

HKLM is the name of a 'drive'.   So it should be followed by a colon :

Set-Location HKLM:

which gets you to the root of that registry hive.  From there you can move down the hierarchy, for example:

Set-Location Software\Microsoft

 


Thursday, December 23, 2010 2:56 AM ✅Answered | 2 votes

I noticed that you posted a duplicated thread that was answered:

 

http://social.technet.microsoft.com/Forums/en-US/ITCG/thread/dea2a516-6e36-4b85-87a1-eb6c62bb6231

 

The answer is:

 

You need to add a colon after HKLM:

 

set-location hklm:

 

Best Regards

Dale

Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. ”


Wednesday, December 22, 2010 4:05 PM

Post can be removed.  Was cross-posted to and answered on another forum. [string](0..33|%{[char][int](46+("686552495351636652556262185355647068516270555358646562655775 0645570").substring(($_*2),2))})-replace " "