script???
-
not sure if i should post here or not, but need some help wit a error i keep getting here is the code ******************************************* 'Jim Lawrence 'Change PC Name Utility Option explicit Set ws = WScript.CreateObject("WScript.Shell") Dim ws, Regkey1, RegKey2, PCName , p1, g, Title Dim itemtype RegKey1 = "HKLM\system\currentcontrolset\control\ComputerName\" p1 = ws.RegRead(RegKey1 & " ComputerName")<----- Error Here see below ***** 'g = ws.RegRead(RegKey2 & " ComputerName") Title = "Change Computer Name Utility" MsgBox n PCName = InputBox("Type the new PC Name", Title, NM) If PCName <> "" Then ws.RegWrite RegKey1 & "ComputerName", PCName End If ************************************************* Unabe to open registry key "HKLM\system\currentcontrolset\control\ComputerName\ComnputerName" for reading code: 80070002 Source: WshShell.RegRead Any ideas will be greatly appreciated thanks in advanced
-
not sure if i should post here or not, but need some help wit a error i keep getting here is the code ******************************************* 'Jim Lawrence 'Change PC Name Utility Option explicit Set ws = WScript.CreateObject("WScript.Shell") Dim ws, Regkey1, RegKey2, PCName , p1, g, Title Dim itemtype RegKey1 = "HKLM\system\currentcontrolset\control\ComputerName\" p1 = ws.RegRead(RegKey1 & " ComputerName")<----- Error Here see below ***** 'g = ws.RegRead(RegKey2 & " ComputerName") Title = "Change Computer Name Utility" MsgBox n PCName = InputBox("Type the new PC Name", Title, NM) If PCName <> "" Then ws.RegWrite RegKey1 & "ComputerName", PCName End If ************************************************* Unabe to open registry key "HKLM\system\currentcontrolset\control\ComputerName\ComnputerName" for reading code: 80070002 Source: WshShell.RegRead Any ideas will be greatly appreciated thanks in advanced
Try to check the information from here[^]. On the other hand, I think you should put the complete name in the path to the specific place in the registry key. jlawren7 wrote: HKLM\system\currentcontrolset\control\ComputerName\ComnputerName It should change too:
HKEY_LOCAL_MACHINE\system\currentcontrolset\control\ComputerName\ComnputerName
or:My Computer\HKEY_LOCAL_MACHINE\system\currentcontrolset\control\ComputerName\ComnputerName
Good luck
A thousand mile of journey, begin with the first step. APO-CEDC Save Children Norway-Cambodia Office
-
Try to check the information from here[^]. On the other hand, I think you should put the complete name in the path to the specific place in the registry key. jlawren7 wrote: HKLM\system\currentcontrolset\control\ComputerName\ComnputerName It should change too:
HKEY_LOCAL_MACHINE\system\currentcontrolset\control\ComputerName\ComnputerName
or:My Computer\HKEY_LOCAL_MACHINE\system\currentcontrolset\control\ComputerName\ComnputerName
Good luck
A thousand mile of journey, begin with the first step. APO-CEDC Save Children Norway-Cambodia Office