Trying to rename a computer via the netdom command and force a reboot
- by user57020
Why doesn't this work? it looks like it will but nothing happens.
Option Explicit
Dim wshNetwork
Dim wshShell
Dim PCname
Dim Newname
Set wshNetwork = WScript.CreateObject("WScript.Network")
Set wshShell = WScript.CreateObject("WScript.Shell")
PCname = InputBox("Type in the name of the pc you want to rename")
Newname = InputBox("Type in the name of the new pc name")
wshShell.run("netdom renamecomputer " &PCname& " /NewName:"&Newname& " /reboot:00 " )
'MsgBox("netdom renamecomputer " &PCname& " /NewName:"&Newname& " /reboot:00 /y")