473,396 Members | 1,968 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Registry.

I've been looking and trying for hours and haven't been able to figure out
how to read/write on the registry of a remote-computer with alternate
credentials. I've can do it easily on a local computer but not remotely.

I'm trying to convert my vbscripts to a vb.net program, though I'm thinking
of staying with my scripts after trying to figure this out :)

Any help would be greatly appreciated, here is the piece of VbScript code:

SET LOCATOR = CREATEOBJECT("WBEMSCRIPTING.SWBEMLOCATOR")
SET REGISTRY_SERVICE = LOCATOR.CONNECTSERVER(TARGET, "ROOT\DEFAULT",
ADMUSR, ADMPWD)
REGISTRY_SERVICE.SECURITY_.IMPERSONATIONLEVEL = 3
SET REGISTRY = REGISTRY_SERVICE.GET("STDREGPROV")
REGISTRY.GETSTRINGVALUE &H80000001,
"SOFTWARE\MICROSOFT\WINDOWS\CURRENTVERSION\EXPLORE R\SHELL FOLDERS\", "LOCAL
SETTINGS", LOCAL_SETTINGS



Nov 20 '05 #1
5 3419
Hi,

http://msdn.microsoft.com/library/de...sekeytopic.asp

Ken
-------------------
"Rob Boger" <rb****@usa.com> wrote in message
news:OH****************@TK2MSFTNGP10.phx.gbl...
I've been looking and trying for hours and haven't been able to figure out
how to read/write on the registry of a remote-computer with alternate
credentials. I've can do it easily on a local computer but not remotely.

I'm trying to convert my vbscripts to a vb.net program, though I'm thinking of staying with my scripts after trying to figure this out :)

Any help would be greatly appreciated, here is the piece of VbScript code:

SET LOCATOR = CREATEOBJECT("WBEMSCRIPTING.SWBEMLOCATOR")
SET REGISTRY_SERVICE = LOCATOR.CONNECTSERVER(TARGET, "ROOT\DEFAULT",
ADMUSR, ADMPWD)
REGISTRY_SERVICE.SECURITY_.IMPERSONATIONLEVEL = 3
SET REGISTRY = REGISTRY_SERVICE.GET("STDREGPROV")
REGISTRY.GETSTRINGVALUE &H80000001,
"SOFTWARE\MICROSOFT\WINDOWS\CURRENTVERSION\EXPLORE R\SHELL FOLDERS\", "LOCAL SETTINGS", LOCAL_SETTINGS



Nov 20 '05 #2
Thanks Ken,

Unfortunately I'm not very bright but looking over that example, I'm not
quite sure where or how I can input specific credentials to use. In my work
environment, we log in with our regular NT accounts, but we also have an
domain admin account that we use for doing things like modifying the
registry on a remote computer, etc. So even though I run the application on
my system, it is under my normal account, not my domain admin account. I
guess once the application is done, I could do a 'runas' to open it up, but
would prefer to be able to specify a username and password.

Am I missing something in that code?

I really appreciate your response, sorry if the above is a little
incoherent, I've been up way too long :)
Rob


"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message
news:ub**************@TK2MSFTNGP10.phx.gbl...
Hi,

http://msdn.microsoft.com/library/de...sekeytopic.asp
Ken
-------------------
"Rob Boger" <rb****@usa.com> wrote in message
news:OH****************@TK2MSFTNGP10.phx.gbl...
I've been looking and trying for hours and haven't been able to figure out how to read/write on the registry of a remote-computer with alternate
credentials. I've can do it easily on a local computer but not remotely.
I'm trying to convert my vbscripts to a vb.net program, though I'm

thinking
of staying with my scripts after trying to figure this out :)

Any help would be greatly appreciated, here is the piece of VbScript code:
SET LOCATOR = CREATEOBJECT("WBEMSCRIPTING.SWBEMLOCATOR")
SET REGISTRY_SERVICE = LOCATOR.CONNECTSERVER(TARGET, "ROOT\DEFAULT",
ADMUSR, ADMPWD)
REGISTRY_SERVICE.SECURITY_.IMPERSONATIONLEVEL = 3
SET REGISTRY = REGISTRY_SERVICE.GET("STDREGPROV")
REGISTRY.GETSTRINGVALUE &H80000001,
"SOFTWARE\MICROSOFT\WINDOWS\CURRENTVERSION\EXPLORE R\SHELL FOLDERS\",

"LOCAL
SETTINGS", LOCAL_SETTINGS




Nov 20 '05 #3
Hi,

The line I wanted you to see is The remote computer must be running
the remote registry service.
Ken
---------------
"Rob Boger" <rb****@usa.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
Thanks Ken,

Unfortunately I'm not very bright but looking over that example, I'm not
quite sure where or how I can input specific credentials to use. In my work environment, we log in with our regular NT accounts, but we also have an
domain admin account that we use for doing things like modifying the
registry on a remote computer, etc. So even though I run the application on my system, it is under my normal account, not my domain admin account. I
guess once the application is done, I could do a 'runas' to open it up, but would prefer to be able to specify a username and password.

Am I missing something in that code?

I really appreciate your response, sorry if the above is a little
incoherent, I've been up way too long :)
Rob


"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message
news:ub**************@TK2MSFTNGP10.phx.gbl...
Hi,

http://msdn.microsoft.com/library/de...sekeytopic.asp

Ken
-------------------
"Rob Boger" <rb****@usa.com> wrote in message
news:OH****************@TK2MSFTNGP10.phx.gbl...
I've been looking and trying for hours and haven't been able to figure out how to read/write on the registry of a remote-computer with alternate
credentials. I've can do it easily on a local computer but not remotely.
I'm trying to convert my vbscripts to a vb.net program, though I'm

thinking
of staying with my scripts after trying to figure this out :)

Any help would be greatly appreciated, here is the piece of VbScript code:
SET LOCATOR = CREATEOBJECT("WBEMSCRIPTING.SWBEMLOCATOR")
SET REGISTRY_SERVICE = LOCATOR.CONNECTSERVER(TARGET, "ROOT\DEFAULT",
ADMUSR, ADMPWD)
REGISTRY_SERVICE.SECURITY_.IMPERSONATIONLEVEL = 3
SET REGISTRY = REGISTRY_SERVICE.GET("STDREGPROV")
REGISTRY.GETSTRINGVALUE &H80000001,
"SOFTWARE\MICROSOFT\WINDOWS\CURRENTVERSION\EXPLORE R\SHELL FOLDERS\",

"LOCAL
SETTINGS", LOCAL_SETTINGS





Nov 20 '05 #4
* "Rob Boger" <rb****@usa.com> scripsit:
I've been looking and trying for hours and haven't been able to figure out
how to read/write on the registry of a remote-computer with alternate
credentials. I've can do it easily on a local computer but not remotely.

I'm trying to convert my vbscripts to a vb.net program, though I'm thinking
of staying with my scripts after trying to figure this out :)

Any help would be greatly appreciated, here is the piece of VbScript code:

SET LOCATOR = CREATEOBJECT("WBEMSCRIPTING.SWBEMLOCATOR")
SET REGISTRY_SERVICE = LOCATOR.CONNECTSERVER(TARGET, "ROOT\DEFAULT",
ADMUSR, ADMPWD)
REGISTRY_SERVICE.SECURITY_.IMPERSONATIONLEVEL = 3
SET REGISTRY = REGISTRY_SERVICE.GET("STDREGPROV")
REGISTRY.GETSTRINGVALUE &H80000001,
"SOFTWARE\MICROSOFT\WINDOWS\CURRENTVERSION\EXPLORE R\SHELL FOLDERS\", "LOCAL
SETTINGS", LOCAL_SETTINGS


Remove the 'Set's, then try to use the code in VB.NET. Enclose the
parameter list of 'GetStringValue' into '(', ')'.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #5
Thanks so much, this did the trick!

Thanks again,
Rob
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...

Remove the 'Set's, then try to use the code in VB.NET. Enclose the
parameter list of 'GetStringValue' into '(', ')'.

Nov 20 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Rohit Santhanam | last post by:
As I am reading the .NET documentation, I get the feeling that Microsoft is trying to get rid of the registry. My understanding is that an application built using .NET does not use the registry...
0
by: vincemoon | last post by:
Below is an excerpt from my Registry Log, created by Redmon, showing the process whereby TweakUI added the compressed folder option to the new sub-menu in the right click context menu for open...
1
by: rdavis7408 | last post by:
I have a database that has a form that opens a report using date parameters. I have been using it for six months and last week I began to get the following Error Message: "File sharing lock...
8
by: Al Kaufman | last post by:
I have a simple console app that uses: regSubKey = <some registry key> Dim reg As RegistryKey = Registry.ClassesRoot.OpenSubKey(regSubKey) Dim path As String path = CStr(reg.GetValue(""))
4
by: Bob | last post by:
My question about how to add an assembly search path to VS.NET's IDE remains unanswered, but I'm still faced with a problem possibly associated with this: my exported registry is more than 67MB....
0
by: bazzer | last post by:
hey, im trying to access a microsoft access database from an ASP.NET web application in visual basic 2003.NET. i get the following error when i try running it: Server Error in...
3
by: eSolTec, Inc. 501(c)(3) | last post by:
Thank you in advance for any and all assistance. Is there a way to create a registry key, but orphan it from the program that created it? Reason: Create a key, but not associate it with the...
3
by: Aussie Rules | last post by:
Hi, I want to store some data in the registry, however I have not been able to do this, and think my logic maybe flawed. Firstly I try to open the registry and read in any existing values....
6
by: JOSII | last post by:
Getting a string of boolean value into and out of the registry is no problem. Here's the problem: Although you can place an object into the registry and retreive it, I need to place an ArrayList...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.