Shelling out to the cmd line is always a pain (plus you gotta make sure netdom is there), dealing with quotes in VB and what not.
Probably easier to just go native and use WMI, and as a bonus should work most anywhere. This will join a domain too (you can remove that portion), but you could just leave the rename portion and the reboot portion and you should be good.
This is untested code that I lifted from another site.
Const JOIN_DOMAIN = 1
Const ACCT_CREATE = 2
Dim sCmpName
Dim sUser, sPassword, sDomain, sOU
sUser = "<domainuserid>"
sPassword = "<domainpassword>"
sDomain = "<mydomain>"
sOU = "<ou=myou,dc=mydomain,dc=com>"
sCmpName = InputBox("Enter the new computer name:", "Computer Name")
If sCmpName = "" Then
Wscript.Echo "Exiting script."
Wscript.Quit
End If
Dim oWMI, oCmp, oOS, sReturn
Set oWMI = GetObject("winmgmts:\\.\root\cimv2")
For Each oCmp in oWMI.InstancesOf("Win32_ComputerSystem")
sReturn = oCmp.Rename(sCmpName)
If sReturn <> 0 Then
Wscript.Echo "Rename failed. Error = " & Err.Number & _
vbcrlf & "Exiting script."
Else
Wscript.Echo "Rename successful."
sReturn = oCmp.JoinDomainOrWorkgroup(sDomain, sPassword, _
sDomain & "\" & sUser, sOU, JOIN_DOMAIN+ACCT_CREATE)
If sReturn <> 0 Then
Wscript.Echo "Join domain failed. Error = " & Err.Number & _
vbcrlf & "Exiting script."
Else
Wscript.Echo "Join domain successful."
End If
Wscript.Echo "Rebooting computer..."
For Each oOS in oWMI.InstancesOf("Win32_OperatingSystem")
sReturn = oOS.Reboot
Next
End If
Next