Search notes:

Rename a Windows computer (change hostname)

With PowerShell (and admin privileges)
PS C:> wmic computersystem where name=`"$env:computername`" call rename `"new-computer-name"
Method execution successful.
Out Parameters:
instance of __PARAMETERS
{
        ReturnValue = 0;
};
This strange syntax ("…") is necessary in Powershell to quote the ", and the " are necessary if the computername has special characters such as hyphens.
After executing this command, the system needs to be rebooted for the change to take effect.

See also

HOSTNAME.EXE
wmic computersystem

Index

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/Windows/...', 1758207798, '216.73.216.150', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/Windows/dirs/Windows/System32/wbem/WMIC_exe/alias/computersystem/rename(52): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78