Under W9x the following should work (without fancy)

$Key = "HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\VxD\MSTCP\"
writevalue ($Key,"hostname",@USERID,"REG_SZ")