?
Solved

Changing the computer name under Windows XP...

Posted on 2002-06-17
4
Medium Priority
?
172 Views
Last Modified: 2010-05-18
I'm not sure if this even counts as a VB question or not, but what the hoo..

I'm trying to change the computer name from within a simple VB app I've written.  The original plan was to create a .REG registry file to change the ComputerName key, but under Xp, changing that key has no effect.

I'm an old time .batch file geek, and I don't know two halves about VB.. if I could use a batch file to achieve my goal just as easily, I'd be doing that instead of using VB... but a text interface just isn't the same thing as a simple VB form.  :)  So please gear your answer with my incompitence in mind.

If this is not something that can easily be done through VB, I'll call this question a wash and put it under the Win XP section, but I expect that someone somewhere has tried to do this under VB...

Thank you for your help.
0
Comment
Question by:EDStech
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 2

Author Comment

by:EDStech
ID: 7084221
Also if it matters...

I'm using Visual Basic 6.
I'm using Windows XP Pro.
These machines are not on a domain.

Thanks.
0
 
LVL 18

Accepted Solution

by:
bobbit31 earned 400 total points
ID: 7084241
you can use SetComputerName api:

Private Declare Function SetComputerName Lib "kernel32" Alias "SetComputerNameA" (ByVal lpComputerName As String) As Long

Private Sub Command1_Click()
    Dim retVal As Long
    retVal = SetComputerName(Text1.Text)
end sub
0
 
LVL 2

Author Comment

by:EDStech
ID: 7084289
Well heck, that was easy.  Perfect!

Thank you.
0
 
LVL 18

Expert Comment

by:bobbit31
ID: 7084335
welcome :)
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

719 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question