Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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 stackoverflow.com Mar 12 '13 at 2:18

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

add comment

1 Answer 1

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
add comment

Your Answer

 
discard

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.