473,379 Members | 1,317 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,379 software developers and data experts.

How do I change the computer name

Hi, I tried to use

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

SetComputerName(newname)

newname is the name I want to change to.
But after I reboot the windows 2000 prof. the computer name remained
the same.

Any ideas?

Thanks!

Greg

Nov 21 '05 #1
1 5487
"greg chu" <gr******@wendys.com> schrieb:
Private Declare Function SetComputerName Lib "kernel32" Alias
"SetComputerNameA" (ByVal lpComputerName As String) As Long

SetComputerName(newname)

newname is the name I want to change to.
But after I reboot the windows 2000 prof. the computer name remained
the same.


Use this declare instead:

\\\
Private Declare Auto Function SetComputerName Lib "kernel32.dll" ( _
ByVal lpComputerName As String _
) As Boolean
..
..
..
Dim Success As Boolean = SetComputerName("Bla")
///

First, check the return value. If it is 'False', then check the computer
name (see documentation for information about valid computer names).
Second, note that the name change will take place after a restart.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #2

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

Similar topics

4
by: Dr. StrangeDub | last post by:
Leaving network identification/DNS out of the picture, how does one change the name of a computer in a local Workgroup (in C#)? I implemented the SetComputerName() API call and that only seems to...
3
by: | last post by:
Is there a way to detect if the computer name has been changed in .NET?
4
by: rcmail14872 | last post by:
I have MS SQL Server 2000 evaluation version on my desktop PC. I have the SQL Server client tools (only) on the laptop. The two computers are networked. I had an Access MDB database on my laptop,...
2
by: david | last post by:
When you right click on a file in windows, there is a property of type of file, which seems to associate this file with an application for it. For example, when you double click on a .doc file, the...
27
by: Jon Slaughter | last post by:
Can I modify code that I have included using <?php include("../Index.php"); ?> The Index.php file contains links that need to be modified to work. Index.php is basically an html file uses a...
7
by: imad.sabonji | last post by:
HI I am using Visual Studio.Net 2003 and using C# I would like to know how is it possible to change the Internet explorer window title? ie. i want to get rid of "Microsot Internet Explorer"...
4
by: CDMAPoster | last post by:
In: http://groups.google.com/group/comp.databases.ms-access/msg/f06bd4c45037ef29 Lyle wrote: :Terry Kreft wrote: : :>Suck it and See? :
20
by: Joel Teichroeb | last post by:
In trunk of the svn there is a folder called PCbuild. Now lets say that I am running linux on my Personal Computer and want to build python. I go into the PCbuild directory, but wait. This is for...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...

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.