Re: Registy access via WMI in C#
From: Alek Davis (stop_spam_alek.davis@intel.com)
Date: 01/14/03
- Next message: Erich Cress: "machine.config file and the processmodel user name"
- Previous message: Mike Moore [MS]: "RE: ASP.NET on SAN - not working"
- In reply to: Dr. Strangedub: "Registy access via WMI in C#"
- Next in thread: Dr. Strangedub: "Re: Registy access via WMI in C#"
- Reply: Dr. Strangedub: "Re: Registy access via WMI in C#"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
From: "Alek Davis" <stop_spam_alek.davis@intel.com> Date: Mon, 13 Jan 2003 17:21:22 -0800
Why don't you simply use RegistryKey.OpenRemoteBaseKey method to open a key
on remote machine? This sounds pretty straight-forward.
-- Alek
"Dr. Strangedub" <strangedub@netscape.net> wrote in message
news:3e233198.449674677@news.rsvl.unisys.com...
> We are in the process of converting some specialized ASP web applications
from
> asp (using VBScript / Javascript) to ASP.NET (using C#). One of the
functions
> of our applications is to update the Windows registry on a remote host
(either
> the host where the web exists, or another host). Today the server-side
VBScript
> uses WMI to access the registry via the StdRegProv class as follows:
> ==
> Set objRegistry = GetObject("winmgmts:root\default:StdRegProv")
> lAccess = KEY_NOTIFY + KEY_QUERY_VALUE + KEY_SET_VALUE
> Err.Clear ' Initialize error status
> lRC = objRegistry.CheckAccess(HKEY_LOCAL_MACHINE, shortPath,
lAccess,bGranted)
> ==
>
> I would appreciate any help (code samples, links, other docs) in coding
this
> logic in C#. We picked up the string "winmgmts:root\default:StdRegProv"
used on
> the GetObject call from an example at the online MSDN site -- and there
seemed
> to be no real explanation of how this string gets us to a Namespace.
>
> I know we could simply use the Microsoft.Win32 Namespace if our registry
access
> was limited to the localhost (i.e., the web server host), but we really do
need
> to do remote updates as well.
>
> Thanks in advance for any help on this.
>
> -Michael G. Rose
> Unisys Corp.
> michael.rose@unisys.com
>
>
- Next message: Erich Cress: "machine.config file and the processmodel user name"
- Previous message: Mike Moore [MS]: "RE: ASP.NET on SAN - not working"
- In reply to: Dr. Strangedub: "Registy access via WMI in C#"
- Next in thread: Dr. Strangedub: "Re: Registy access via WMI in C#"
- Reply: Dr. Strangedub: "Re: Registy access via WMI in C#"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|
|