Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Connect Network Registry Using Command Line 1

Status
Not open for further replies.

mdav2

Programmer
Aug 22, 2000
363
GB
Does anyone know of a way that you could run a command line for REGEDIT get it to connect to a network registry if you pass it the address (eg IP address). Similar to opening explorer and passing a starting directory.

I need to incorporate this into an VB application that connects to network machine and automaticall maps a drive to thier shared disk.

Mark Davies
Warwickshire County Council
 
Can you clarify why you want to connect to the remote registry, as I suspect that there may be alternative approaches?
 
If I want to view the registry on a machine from my machine I have to do the following:

1) Run REGEDIT from the command line (START, RUN)
2) Choose FILE, CONNECT NETWORK REGISTRY
3) Put the IP address of the machine I want to connect to
4) Login if prompted

What I want to do is step 1 but try and pass a parameter that also does 2 and 3. So it will open the regitsry editor and connect to an IP address I specify.

Mark Davies
Warwickshire County Council
 
Why do mountain climbers climb mountains, because they can.

I want to do this to incorporate it with a remote management tool I've written. It saves the user having to have to open it themselves. It's just to keep the lazy users happy.

Mark Davies
Warwickshire County Council
 
Right, what we were trying to establish was whether you were trying to open the remote registry to read some remote registry settings and, if so, what those settings might be (mainly because the way the question was written vaguely seemed to imply you might be doing it to read what their shares were so you could map to them). We can now see that this is not the case.

I'm not aware of a way of doing this with REGEDIT
 
Nor am I, but you can open an instance of regedit and use File/Connect Network Registry with the computer name (as opposed to the IP address) to connect to the registry of a computer in your network. You only get the Local Machine and Users hive keys, and I don't see a way to make the connection persist to another instance of regedit (let alone how to run regedit menu commands from a VB program), but this might be of some help.

Bob
 
Is there some reason that you cannot use WMI to do what you want?

[red]"... isn't sanity really just a one trick pony anyway?! I mean, all you get is one trick, rational thinking, but when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick[/red]
 
That's why I was asking what the purpose of the required connection to the registry is for. The OP has now made it clear that they actually want to open RegEdit, but with a remote registry on display rather than the local one.
 
I'm afraid that when I gave my earlier answer of knowing no way to do what the OP asked with a commandline I had taken into account regedit's commandline switches; they don't solve the problem because firstly none of the switches work on remote registries and secondly the
L and R switches - which you might think stand some chance - only work locally and only work on W95, W98 and Me, and even there they don't display the regedit user interface (they are designed to do silent, commandline registry maintenance)
 
I sympathize members asking for clarification on what-for before answering a general question on remote registry manipulation because there are things you can do and there are thing you cannot.

After all the exchange, maybe the op can take a look on reg.exe utility, generally applicable to winnt-series.

Wmi's stdregprov is also a standard way of doing these kinds of thing.
 
Cool. I've bookmarked that page as well.

-David
2006 Microsoft Valueable Professional (MVP)
2006 Dell Certified System Professional (CSP)
 
>remote registry manipulation

That's the important point. The OP has made it clear that all they want to do is to open the RegEdit GUI with a remote registry being displayed rather than the local one, not to manipulate or examine any specific keys
 
Maybe op just meant regedit and its relatives. In that case, maybe regedt32.exe would help. In any case, remote hive such as hkcu would not be readily avail---that illustrates the meaning of something might not be done, or at least not be done without some twist.
 
> In any case, remote hive such as hkcu would not be readily avail ... something might not be done

Quite. As I said right near the start of the thread, I don't know of a way to do what the OP wants with the tools they specify

>maybe regedt32.exe would help

On XP and W2K3 (and presumably Vista, although I have not checked) regedt32 is just a stub for regedit (although this is a new version of regedit that includes most of the functionality that was originally in regedt32), not a seperate program.
 
Thanks for al the posts, I'll have to convince Bill to include it in his next release of the MS OS.

Mark Davies
Warwickshire County Council
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top