473,804 Members | 3,716 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How do I change the computer name

Hi, I tried to use

Private Declare Function SetComputerName Lib "kernel32" Alias
"SetComputerNam eA" (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 5531
"greg chu" <gr******@wendy s.com> schrieb:
Private Declare Function SetComputerName Lib "kernel32" Alias
"SetComputerNam eA" (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.d ll" ( _
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
14308
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 change the NetBIOS Computer Name. I've verified that the underlying registry key value that gets changed is: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\ComputerName\ComputerName\ComputerName Is there a recommended API (via Active...
3
1487
by: | last post by:
Is there a way to detect if the computer name has been changed in .NET?
4
14031
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, but I converted it with the Access upsizing wizard to an Access ADP database with the Access front-end on the laptop connecting to the SQL Server on the desktop. Now I want to move from this test environment to the "real" server. How do I go about...
2
1981
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 microsoft word application is activiated and open the file. I have the following question: When I instored my image files in my computer, the system assign the default application to files automatically so that whenever I double click any...
27
1938
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 linked css file and when its included in the new file its referencing a css file in the wrong spot. I need to add "../" to the css file reference in Index.php to make it work.
7
5760
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" that appears after my application name on the title bar and if possible, get rid of the IE logo at the start of the address bar.
4
2340
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
1937
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 windows not for any personal computer. Calling Windows PC seems to be something that Apple did so they would not have to directly mention Windows. Could all the places that say PC that are not referring to Personal Computers in general be...
0
9707
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9585
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
10586
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...
1
10323
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,...
0
10082
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7622
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
6856
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
5658
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4301
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

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.