updated. strcn = InputBox("Change Name to the following","Please Enter Computername", compname) Name = strcn name= UCase(Name) If Len(name) > 15 Then Wscript.echo "The name is too long for use with wins" wscript.quit End If If Len(name) < 1 Then Wscript.echo "The name is too short to be used" wscript.quit End If Set objRegEx = CreateObject("VBScript.RegExp") objRegEx.Global = True objRegEx.Pattern = "[^A-Z0-9]" strSearchString = name Set colMatches = objRegEx.Execute(strSearchString) If colMatches.Count > 0 Then Wscript.Echo "The following characters are not allowed:" For Each strMatch in colMatches Wscript.Echo strMatch.Value wscript.Quit Next End If strComputer="." Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2") Set colComputers = objWMIService.ExecQuery ("Select * from Win32_ComputerSystem") For Each objComputer in colComputers err = objComputer.Rename(name) if err <> 0 then wscript.echo "There was an error renaming the machine. Please restart, and try again." else wscript.echo "Machine successfully renamed: " & Name end if Next