I’m trying to change a computer’s name (host name) on Windows 2000 using .NET 2.0. The computer is not joined to a domain.
Windows XP and higher provides the WMI method Win32_ComputerSystem.Rename, but this is not available in Windows 2000 (reference here).
I’m not averse to just calling an external program if I need to, but I also can’t seem to find one that works on Windows 2000. Searching on Google didn’t seem to turn up anything obvious.
Thanks in advance.
I think the Windows API might be of help on Windows 2000: Use
SetComputerNameEx:This sample is based on the sample on pinvoke.net:
In addition to p-invoking the WinAPI you might also use
Process.Startin combination with thenetshcommand as described here.