473,765 Members | 2,086 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

C# and the registery

I've got 20 PC's that I need to change the Description/name field for each
NIC, and each PC has three NIC adapters (all PC's are the same Hardware). I
know how to change it maunaully in the registery, but I need to do this in
C#.

I know the path
HKLM\System\Con trolset001\Cont rol\Network\{4D 36E972-........} is the same on
all my PC's but the folders beneth that path are all different from PC to
PC, and I want to go into each one and change the name key within the
connection folder.

Since I can use a static path name to change, how would I loop through them
to change that string?

Any ideas?
Apr 7 '07 #1
2 1425
Jason,

Doing it this way is the last way I would recommend performing this
task.

Rather, use the classes in the System.Manageme nt namespace to set the
properties on the WMI classes for each of the NIC cards in each of the
machines.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"Jason" <wh*@microsoft. comwrote in message
news:eF******** *****@TK2MSFTNG P06.phx.gbl...
I've got 20 PC's that I need to change the Description/name field for each
NIC, and each PC has three NIC adapters (all PC's are the same Hardware).
I know how to change it maunaully in the registery, but I need to do this
in C#.

I know the path
HKLM\System\Con trolset001\Cont rol\Network\{4D 36E972-........} is the same
on all my PC's but the folders beneth that path are all different from PC
to PC, and I want to go into each one and change the name key within the
connection folder.

Since I can use a static path name to change, how would I loop through
them to change that string?

Any ideas?


Apr 7 '07 #2
Yeah, I found out you have to go through the registery. That property is a
read only one.
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard .caspershouse.c omwrote in
message news:ej******** ******@TK2MSFTN GP02.phx.gbl...
Jason,

Doing it this way is the last way I would recommend performing this
task.

Rather, use the classes in the System.Manageme nt namespace to set the
properties on the WMI classes for each of the NIC cards in each of the
machines.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"Jason" <wh*@microsoft. comwrote in message
news:eF******** *****@TK2MSFTNG P06.phx.gbl...
>I've got 20 PC's that I need to change the Description/name field for
each NIC, and each PC has three NIC adapters (all PC's are the same
Hardware). I know how to change it maunaully in the registery, but I need
to do this in C#.

I know the path
HKLM\System\Co ntrolset001\Con trol\Network\{4 D36E972-........} is the same
on all my PC's but the folders beneth that path are all different from PC
to PC, and I want to go into each one and change the name key within the
connection folder.

Since I can use a static path name to change, how would I loop through
them to change that string?

Any ideas?



Apr 9 '07 #3

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

Similar topics

2
388
by: Rob R. Ainscough | last post by:
How can I permit my ASP.NET web app access to the Event Log? I sometimes use the application Event log to write out debug info when I'm testing -- but I get an error: "Requested registry access is not allowed." Is there anyway around this? Rob.
1
1078
by: Stuart Norris | last post by:
Dear Readers, I am writing an application that will be installed on Windows XP Professional in a non-administrative account. Can this program create keys in the HKEY_LOCAL_MACHINE \ SOFTWARE registery section? What permissions does the account which will run this application need so I can create these registery keys?
7
2023
by: Brian Henry | last post by:
I am trying to deploy my VB.NET project with a setup project, and I need to make a reg key entry.. but it also needs to have the path to where the program was installed in they string i placed in the key. How do I go about insertint the installation path (folder only) to the file into the registery on installation of the setup project? Say my project was installe to "c:\program files\myproject" I want to make a registry key string at...
1
2748
by: method | last post by:
I am trying to delete registery key encluding all its subkeys . I want to delete the bold part HKEY_CURRENT_USER, "Software\xyz\foldername\" using an api that i found on the net but i keep geting error!! could any one tell me how to delete entire key with its subkeys ? I changed : Private Sub Command3_Click()
1
1734
by: method | last post by:
Hi all i am usiing this code to write mulitiple values to registery but it only write one value. could any one help me make this code so that it write multiple values to registery. Currently it only writes nickname but not pwd value!! I tried this but gave me error : 'Save the value to the registry SaveString HKEY_CURRENT_USER, "Software\xyz\" + Text6.Text, "nickname",+Text7.Text "pwd", strString
0
784
Ali Rizwan
by: Ali Rizwan | last post by:
Hi all, How can i read any registery using vb6
1
1028
Ali Rizwan
by: Ali Rizwan | last post by:
I m asking this question for 4 days that how can i read, write a registry. I want to change volume background and password username of windows programatically but no one is answering me?
1
1080
by: =?Utf-8?B?VG9ueSBU?= | last post by:
I was tidying up my fonts and I have managed to replace the font that normally appears when you click on print to a font that is about size 26. I have no idea how to reset it can anyone please advise. Thanks Tony
1
1046
by: SaqibKhan | last post by:
Hello members ! a message box is appearing when I goto 'ToolsReferences' in VBA or VB6. I have tried many options but issue is not resolved yet. I have no administrator's rights in PC. can anybody resolve my problem ??? Best Regards M. Saqib Khan
0
9393
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10153
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10007
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9946
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7371
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6646
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5272
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3921
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2800
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.