Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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 want to delete an HCKU registry on a remote PC. On a local PC, the command is the following:

reg delete "hkcu\printers\connections" /f

However, how can I do this to a remote PC? The command help for reg delete says only HKLM and HKU (not HKCU) are available on remote machines.

I'm working in XP/Win7

Thanks, G.

share|improve this question

migrated from Mar 12 '13 at 2:18

This question came from our site for professional and enthusiast programmers.

You need to find user's SID first. For that you can use wmic or any other way you want:

wmic /node:<computer-name> useraccount get name,sid

Then you just run

reg delete "\\<computer-name>\HKU\<SID>\printers\connections" /f
share|improve this answer
This only works if the user's registry hive is loaded, and it cannot be done using reg load over the network (but might be possible using regedit or other tools, or using reg load over SSH, or over PowerShell Remoting). – grawity Mar 12 '13 at 14:34
When I enter the command "wmic /node:W2-IS-2R04MS1 gbcrondock get name,sid" I get "Invalid Global Switch" - I'll try enclosing the PC name in quotes... – user2158805 Mar 12 '13 at 15:33
Ultimately, I want to remotely delete the PC's printer connections, not just the user's printer connections. So, perhaps there's another way to do this aside from deleting the hkcu thingy. – user2158805 Mar 12 '13 at 15:36

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.