Change machine name/IP address

Quick question: I need to change the machine name programmatically. I wasn't able to spot
the API call quickly, and hoped that someone might have the answer.

Why? We're ghosting 20-30 machines at once from the same master, and need to run a program
that will 

(a) Set the machine name (it will prompt, and the names are of the form XXXXnnnn where
nnnn is a 4-digit number)
(b) Set the IP address to 10.0.nn.nn (we have no DHCP server)
(c) Enable the C drive to be shared by everyone (I think I can figure this out, but if
someone has a code snippet it will save me some time)

The point here is to be able to reghost an entire lab (yes, they have legitimate licenses
to support these machines) after each class finishes using the machines, and in a
reasonable time. (I'm involved in some volunteer efforts, and it looks like we can get
access to a set of machines but only if we can reset the machines completely to the
original configurations)
					joe

Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
0
newcomer (15973)
7/29/2003 6:11:53 AM
vc.mfc 33608 articles. 0 followers. Follow

2 Replies
628 Views

Similar Articles

[PageSpeed] 10

Change Ip Adress

1. Open registry on the HKEY_LOCAL_MACHINE

2. Find the subKey = SOFTWARE\Microsoft\Windows
NT\CurrentVersion\NetworkCards\"netcard# "

"netcard# " usually is "1" but you can control any subkey and find specific
netwrok Adapters

Refer to "MSDN Registry Entries for Network Adapter Cards"

3. Get data for the value "ServiceName"

4. Find the subKey =
SYSTEM\CurrentControlSet\Services\"ServiceName"\Parameters\TcpIp"

5. Set data for the value "IpAddress" to change IP address

6. Set data for the value "SubnetMask" to change subnet mask

7. Set data for the value "DefaultGateway" to change default gateway

8. Reboot your PC.


 set local machine HostName

Follow this steps :

1. Open registry on the HKEY_LOCAL_MACHINE

2. Find the subKey = SYSTEM\CurrentControlSet\Services\TcpIp\Parameters

3. Set data for the value "HostName"

4. Find the subKey =
SYSTEM\CurrentControlSet\Control\ComputerName\ComputerName

5. Set data for the value "ComputerName"

6. Reboot your PC and HostName will be set.



NetShareAdd seems to be the most logical API call to share the C Drive.

"Joseph M. Newcomer" <newcomer@flounder.com> wrote in message
news:ml3civ4qr9qtuu985ivokba2222qscbfdp@4ax.com...
> Quick question: I need to change the machine name programmatically. I
wasn't able to spot
> the API call quickly, and hoped that someone might have the answer.
>
> Why? We're ghosting 20-30 machines at once from the same master, and need
to run a program
> that will
>
> (a) Set the machine name (it will prompt, and the names are of the form
XXXXnnnn where
> nnnn is a 4-digit number)
> (b) Set the IP address to 10.0.nn.nn (we have no DHCP server)
> (c) Enable the C drive to be shared by everyone (I think I can figure this
out, but if
> someone has a code snippet it will save me some time)
>
> The point here is to be able to reghost an entire lab (yes, they have
legitimate licenses
> to support these machines) after each class finishes using the machines,
and in a
> reasonable time. (I'm involved in some volunteer efforts, and it looks
like we can get
> access to a set of machines but only if we can reset the machines
completely to the
> original configurations)
> joe
>
> Joseph M. Newcomer [MVP]
> email: newcomer@flounder.com
> Web: http://www.flounder.com
> MVP Tips: http://www.flounder.com/mvp_tips.htm


0
schanna (2)
7/29/2003 7:03:12 AM
Much thanks!
				joe

On Tue, 29 Jul 2003 03:03:12 -0400, "Steve" <schanna@columbus.rr.com> wrote:

>
>Change Ip Adress
>
>1. Open registry on the HKEY_LOCAL_MACHINE
>
>2. Find the subKey = SOFTWARE\Microsoft\Windows
>NT\CurrentVersion\NetworkCards\"netcard# "
>
>"netcard# " usually is "1" but you can control any subkey and find specific
>netwrok Adapters
>
>Refer to "MSDN Registry Entries for Network Adapter Cards"
>
>3. Get data for the value "ServiceName"
>
>4. Find the subKey =
>SYSTEM\CurrentControlSet\Services\"ServiceName"\Parameters\TcpIp"
>
>5. Set data for the value "IpAddress" to change IP address
>
>6. Set data for the value "SubnetMask" to change subnet mask
>
>7. Set data for the value "DefaultGateway" to change default gateway
>
>8. Reboot your PC.
>
>
> set local machine HostName
>
>Follow this steps :
>
>1. Open registry on the HKEY_LOCAL_MACHINE
>
>2. Find the subKey = SYSTEM\CurrentControlSet\Services\TcpIp\Parameters
>
>3. Set data for the value "HostName"
>
>4. Find the subKey =
>SYSTEM\CurrentControlSet\Control\ComputerName\ComputerName
>
>5. Set data for the value "ComputerName"
>
>6. Reboot your PC and HostName will be set.
>
>
>
>NetShareAdd seems to be the most logical API call to share the C Drive.
>
>"Joseph M. Newcomer" <newcomer@flounder.com> wrote in message
>news:ml3civ4qr9qtuu985ivokba2222qscbfdp@4ax.com...
>> Quick question: I need to change the machine name programmatically. I
>wasn't able to spot
>> the API call quickly, and hoped that someone might have the answer.
>>
>> Why? We're ghosting 20-30 machines at once from the same master, and need
>to run a program
>> that will
>>
>> (a) Set the machine name (it will prompt, and the names are of the form
>XXXXnnnn where
>> nnnn is a 4-digit number)
>> (b) Set the IP address to 10.0.nn.nn (we have no DHCP server)
>> (c) Enable the C drive to be shared by everyone (I think I can figure this
>out, but if
>> someone has a code snippet it will save me some time)
>>
>> The point here is to be able to reghost an entire lab (yes, they have
>legitimate licenses
>> to support these machines) after each class finishes using the machines,
>and in a
>> reasonable time. (I'm involved in some volunteer efforts, and it looks
>like we can get
>> access to a set of machines but only if we can reset the machines
>completely to the
>> original configurations)
>> joe
>>
>> Joseph M. Newcomer [MVP]
>> email: newcomer@flounder.com
>> Web: http://www.flounder.com
>> MVP Tips: http://www.flounder.com/mvp_tips.htm
>

Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
0
newcomer (15973)
7/29/2003 8:47:54 PM
Reply:

Similar Artilces:

External data link change
Hi, I've a sheet linked to an external data on the net, and I would like that a cell in this sheet to indicate the last date and time it was updated, the simplest way the better but I can do some programming too. Thanks for your attention, -- Domingos Junqueira No need of help any more, I solved the question. Thanks again ...

AddIn Functions Have File Path and #NAME? Error
Hello, How do I get Excel 2007 to drop the file path on formulas with Excel addin functions in them? I've just upgraded from Office 2003 to 2007 on XP and am having some trouble with my Excel addin workbook functions. There are a number of addins that are kept in a directory on the computer, C:\ExcelAddins. They are updated from time to time and so everyone has them in this directory on there computer so IT can upload updates. After the Office 2007 upgrade I added all these addins to Excel 2007. In 2003 I would be able to access the addin functions by typing in the name and pa...

Why does the change change to a number?
Hi all, I've noticed something wierd and always wondered WHY it happens. When you type a date into a cell, and then change the Formatting of it to a 'general' cell, it turns into a number. How does it come up with that number? What is the significance? i.e. type today's date of "12/7/2007" - change it to a 'General' format, and it then says "39423". I'm a trainer of Excel and this question always comes up. I'm curious myself too. Thanks! Joe It's the number of days since January zero 1900 using Excel default for windows (M...

If my System.IO.StreamWriter Write method throws "The specified network name is no longer available." and I try to Dispose or Close it in the finaly clause the close or dispose method just throws "The
If my System.IO.StreamWriter Write method throws "The specified network name is no longer available." and I try to Dispose or Close it in the finaly clause the close or dispose method just throws "The specified network name is no longer available." again. how to clean this up? after this the stream writer is stuck connected until i restart my process. ...

changing the way Excel displays selected cells
Is there a way to change the way Excel displays selected cells? I'm interested in viewing all the selected cells highlighted (with light blue for instance), but by default excel highlights all the cells but not the first one the same occurs when you define a range with no adyacents cells Your definition of the display is not quite correct. Excel highlights the current cell, Excel also highlights a selecte range. The currently selected cell is generally the first of a range, bu press enter and the current cell changes and becomes the second, the third etc in the range. You cannot...

DST changes for Exchange 5.5
I noticed the 2007 DST Calendar Update "Exchange tool" is available now: http://support.microsoft.com/kb/930879 This will seemingly take care of calendars for mailboxes still on Exchange 5.5 servers, as Exchange 5.5 is listed as "compatible" . However would this address the CDO issues such as BlackBerry users and OWA users still on Exchange 5.5 ? Thanks in advance, Itrcb4 On Mon, 12 Feb 2007 14:31:00 -0800, itrcb4 <itrcb4@discussions.microsoft.com> wrote: >I noticed the 2007 DST Calendar Update "Exchange tool" is available now: > >http://su...

Track Changes
How do i remove the track changes in outlook? When i press "Enter", a symbol that represents "Enter" will appears. Same for space etc. ...

more on VBA function name change
I thought I'd start a new thread since I haven't received any replies to my first one... To recap: I've declared a function in a module using mixed case: Function TMDE_Category (FormName As Form) I noticed recently that it appeared in the module as Function tmde_category(FormName As Form) I changed it back to the mixed case declaration, saved the module, exited the app, reopened it and looked. The function had changed back to the all lowercase declaration. Things I've tried since the original post: Using the databse documenter, I selected all ob...

Can't Publish changes with Deploy Manager
After a migration process, I can't publish the changes made on CRM. When I try do this in Deploy Manager I get the follow error: ---------------------------------------------------------------------------- ----- Publish done with errors. See the event log to get deitails NETRA-INOVACAO: ***Error*** Failed to download XSL template files from Web Server ---------------------------------------------------------------------------- ----- Can somebody help me? I don't know if the migration process have any relationship with the error. Thank you for pay attention. []'s Vin�cius Pitta...

How to change icon for my application
Hi, I am currently developing an application on visual studio 6.0, and i wish to change the MFC icon on my application header. Anyone can help? Thank you. Raed Sawalha wrote: > Hi, I am currently developing an application on visual studio 6.0, and i > wish to change the MFC icon on my application header. Anyone can help? Thank > you. > > Open the icon resource for editing by double clicking. Then notice the control just above the editing grid that lets you switch between editing the large icon and editing the small one. -- Scott McPhillips [VC++ MVP] thanx that work...

How to change newsgroup message font
Like many other ribbon based programs I sometimes struggle to find how to make a change. This time its how to change the font just for newsgroup messages? regards "nobody" wrote in message news:EWTao.39493$GF5.7129@hurricane... > Like many other ribbon based programs I sometimes struggle to find how to make a change. This time its how to change the font just for newsgroup messages? Newsgroup messages are usually plain text. The font used is that selected at [no name tab] > Options > Mail > Read > Fonts for the encoding specified for the messag...

Notify change of email address when changing ISP
How do I notify my entire address book of an email address when I change ISP's? Thanks By sending a mail to everyone ? If you do so, please use BCC for the adresses, this way you won't spread everybody's e-mail adres to everybody. Niels Bob Baker wrote: > How do I notify my entire address book of an email address when I change ISP's? > Thanks ...

Address Search
Hi Group, Newbie trying to learn some basics. I have a list of addresses and have created queries to return postcode matches. Each query returns perhaps 20 different addresses. To cut this list down I've created a query using a table which provides the property number and the postcode. That works fine. Where I get stumped is where the property has a name not a number or perhaps both. I am trying, so far without success, to compile a query that looks for postcode and either property number or name, which would include an added safeguard that would return alternate property matches i...

Change a formula to an acual number
I want to change the formula I have created to the number it has created Example: Cell A1 is the number 1. Cell A2 is the formula =a1+1 creatin the number 2. I want this to be a two not a formula. Any ideas? Laura, copy, then paste special, valves -- Paul B Always backup your data before trying something new Please post any response to the newsgroups so others can benefit from it Feedback on answers is always appreciated! Using Excel 2000 & 97 ** remove news from my email address to reply by email ** "Laura" <anonymous@discussions.microsoft.com> wrote in message news...

Problem Changing an Investment Name
I am trying to change an investment name and Money 2006 tells me "The name or symbol 'TRP Spectrum Income' has already been used for a deleted investment. Please enter a different name." When I go to delete investments the name does not appear! Any ideas on how I get Money to accept the name change? This is the first time I have run into this situation and I have made numerous name changes in Money over the years. In microsoft.public.money, Ken wrote: >I am trying to change an investment name and Money 2006 tells me "The name >or symbol 'TRP Spec...

Should I change this code?
Should I change 556 to 560???..............Thanks for your help..........Bob Private Sub Command560_Click() On Error GoTo Err_Command556_Click Dim stDocName As String Dim stLinkCriteria As String stDocName = "frmClientInfomation" DoCmd.OpenForm stDocName, , , stLinkCriteria Exit_Command556_Click: Exit Sub Err_Command556_Click: MsgBox Err.Description Resume Exit_Command556_Click End Sub On Sun, 15 Jul 2007 16:37:26 +1200, "Bob V" <rjvance@ihug.co.nz> wrote: > >Should I change 556 to 560???..............Thanks for your help.....

How to change default font in Outlook 2003
Can someone tell me how to change tthe default font in Outlook 2003 when composing a new email. It always comes up as Times New Roman. I remember somewhere that I specified that Outlook should use Word as the text editor and that seems to be the case. I have Arial as my default font in Word but this seems to make no difference when using Outlook. Hi, Please go to Tools > Setting > Mail Format > Stationery and Fonts > Fonts It's right there :) On 20 Nov 2005 06:28:45 -0800, amarsarit@gmail.com wrote: >Hi, >Please go to Tools > Setting > Mail Format > Statione...

icon changes with change of extension
when we change the extension of a file in windows, its icon also changes..... how does windows do tht. in my application i require a similar approach. i want the icon to be dependent on the file extension not on the attributes of the file. i have gone trough the registry but things are not very clear. Windows has listed all the file extensions avaliable there, but there is no general way to extract icons for those extension... kindly help icon changes with change of extension "Neelu" <nemesia31@gmail.com> wrote in message news:1161232739.720722.120950@b28g2000cwb.google...

Moving exchange2k3 server machine account from default OU to another...
Hi all. I have an win2k3 std sp1 server with exchange2k3 std sp2 on it. The computer account of the server sits in the default Computers OU, and i want to move it to another computer OU for policy purposes. I have a 2k AD. I understand that this move should go without a problem, maybe a restart of the services afterwards? I'm not going to move any of the objects in the Microsoft Exchange System Objects OU, just the computer account. Any problems that might occur, and would those potential problems be ok if i just move it back to the default OU? -- Gripe On Fri, 19 May 2006 ...

Blocking email address
we have exchange 2003 server. we wanted to block certain email address so that no one in our organization gets that email. Could anyone tell me how to acheive this? Install an antispam service. Perhaps IMF will allow you to do this. -- Ed Crowley MVP - Exchange "Protecting the world from PSTs and brick backups!" "ANDY" <ANDY@discussions.microsoft.com> wrote in message news:44892250-76C8-418D-9705-DAE7F407A699@microsoft.com... > we have exchange 2003 server. we wanted to block certain email address so > that no one in our organization gets that email. Coul...

Field Type Change
I am trying to change a free text field to a drop down menu in my current database, that already has data entered for this particular field, in order to avoid multiple versions of the same organization that are just typed in differently. I'm assuming that I'll need to recode the different versions of an entry to make them uniform but after that, I'm unsure how to proceed so I won't lose any data. Is this possible or will I need to delete the field, recreate it as a drop down and then re-enter the data? Thanks in advance! Mike Thanks everyone for all the input and advice s...

Ship to address
In POP the ship to address does not default into the Purchase Order. I can expand the item and insert an ID, but I would like to have it default from the Vendor. The PO's that are generated from Manufacturing orders have the ship to address printed on the PO automatically. I have the Sites linked to the appropriate address. What am I missing? -- Karla R Karla, I am not well versed with the functionality, but considering your query, I doubt whether you can default it from Vendor. Ship To Address ID for a PO Line Item is nothing but the Site Address to which this Item is going t...

Tracking Changes
I am the author of a document and am making revisions to it. I want to chnage the redline color to denote new edits from the 1st version. Can anyone guide me through this process? I am sure it is easy but I cannot figure it out. THanks Peter On Wed, 10 Feb 2010 07:08:06 -0800, Peter SSI <Peter SSI@discussions.microsoft.com> wrote: >I am the author of a document and am making revisions to it. I want to >chnage the redline color to denote new edits from the 1st version. Can >anyone guide me through this process? I am sure it is easy but I cannot >figure i...

Save Changes? #2
Sometimes, but not always, Excel asks if I want to save the current file, even though I've made no changes. Does anyone know why this occurs, and if there is a setting I can change to avoid the prompt unless actual changes are made? Thank you. Sprinks There are a number of functions that will update themselves when the workbook is opened, and this causes Excel to act as though the workbook has been changed. These functions include NOW() , TODAY(), ROW(), etc. See Volatile Functions in help for more info. -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consult...

colour change of dated box
How can I change the colour of a dated box of excel after the date is over. I want the programme to read date automatically from pc and change colour. try Conditional Formatting In 2003: 1. Select the cells you want to format 2. Choose Format, Conditional Formatting 3. Choose Cell Value Is from the first drop down 3. Choose Formula is from the first drop down 4. Choose less than 5. In the third box, enter =TODAY() 6. Click the Format button 7. Choose a color on the Patterns tab (or any available option) 7. Click OK twice. -- Hope this is helpful Appreciate that you provide your feedbac...