No announcement yet.

Modifying rename script on sysprep machine

  • Filter
  • Time
  • Show
Clear All
new posts

  • Modifying rename script on sysprep machine

    Hello to all,

    First to all and in advance, thanks to all of you in past times when it came to my rescue.

    The reason to post again here is to request your help and wisdom so let's cut to the chase. I am syspreping a bunch of vista machines. The sysprep process is not in question here but the fact there is a bug in the process and the machine gets created with a weird name. I found a vbscript online to rename the machines so I added into the SetupComplete.cmd. The vbscript works great when you have a extra window to retrieve the hostname for the machine but since it's the script is part of the installation process, it fails all the time because there is no way to get that first component. I am not a VBscript expert but I would like to know if there is a way to pull the hostname to be the first variable and only solicit the new name. Below is the code of the vbscript for anyone to add their suggestion.

    Thanks for any input in advance,

    'open the file system object
    Set oFSO = CreateObject("Scripting.FileSystemObject")
    set WSHShell = wscript.createObject("")
    Dim sNewCname     'Variable to hold Computer Name you enter in the inputbox
    Dim sOldCname        'computers current name
    'First param is message text, second is message title
    sOldCname = InputBox("Enter computers current name","Windows 2k3 Netdom Rename Script")
    sNewCname = InputBox("Enter computers new name","Windows 2k3 Netdom Rename Script")
    Call WSHShell.Run("cmd.exe /K netdom renamecomputer " & sOldCname & " /newname:" & sNewCname & " /userd:DOMAIN\admin /passwordd:DOMAINPASSWORD /usero:DOMAIN\ADMINISTRATOR /passwordo:localpassword /force ")
    Last edited by Rems; 9th July 2010, 00:11.