[VBScript] Change Computer Name

Computer hardware, software and services.
User avatar
vinay Male
Status: Offline
Posts: 1393
Joined: December 2007
mig33 ID: STFU
Location: India
Country: India

[VBScript] Change Computer Name

Postby vinay on Sat Mar 29, 2008 4:12 pm

Change Computer Name using VBScript
Hi friends, We can change name of our computer with using the following script:

*Open notepad and type the quoted text:

Code: Select all
Option Explicit

Set ws = WScript.CreateObject("WScript.Shell")
Dim ws, t, p1, p2, n, cn, vbdefaultbutton
Dim itemtype

p1 = "HKLM\SYSTEM\CurrentControlSet\Control\ComputerName\ComputerName\"

n = ws.RegRead(p1 & "ComputerName")
t = "Change Computer Name    Ask-Vinay"
cn = InputBox("Type new Name and click OK", t, n)
If cn <> "" Then
  ws.RegWrite p1 & "ComputerName", cn
End If


*Save it as.. filename.vbs

*Double click on the file to execute this..

*Enter your desired computer name and press OK.

Image
Image
**** Be the change you wish to see in the world.****

[VBScript] Change Computer Name

Sponsor

Mig33
 

User avatar
rahber Male
Status: Offline
Posts: 954
Joined: October 2007
mig33 ID: rahber
Location: Pakistan
Country: Pakistan

Re: [VBScript] Change Computer Name

Postby rahber on Sun Mar 30, 2008 7:24 am

ahan.. nice info bro
but what that we manually chnge the pc name in going to system options ? is it the same procudure?
noob of the year :|

User avatar
vinay Male
Status: Offline
Posts: 1393
Joined: December 2007
mig33 ID: STFU
Location: India
Country: India

Re: [VBScript] Change Computer Name

Postby vinay on Sun Mar 30, 2008 11:33 am

rahber wrote:but what that we manually chnge the pc name in going to system options ? is it the same procudure?

Yes! Both are same procedure bro rahber ! :D
Image
**** Be the change you wish to see in the world.****

User avatar
rahber Male
Status: Offline
Posts: 954
Joined: October 2007
mig33 ID: rahber
Location: Pakistan
Country: Pakistan

Re: [VBScript] Change Computer Name

Postby rahber on Mon Mar 31, 2008 5:09 pm

ahan thnx for the clarification bro :)
noob of the year :|

User avatar
XMaiev Male
Status: Offline
Posts: 600
Joined: April 2009
mig33 ID: x-maiev
Location: Egypt
Country: Egypt

Re: [VBScript] Change Computer Name

Postby XMaiev on Fri Apr 24, 2009 5:13 pm

int, thanks s s s s
Image
Image
______________________________________________________________________________________________
If you are looking for (The) brother, (The) friend. I'm here! I'm waiting... :love:


Return to Computers

Who is online

Users browsing this forum: No registered users and 2 guests