So I've been using the built in K2000 Get and Set computer name scripts and generally they work well. However if the imaging process fails and needs to be reran the name of the machine is lost. This is especially bad in my case since I have to image multiple labs.

Is there any way to have the name of the machine not get lost in case the imaging process fails and needs to be restarted?

Thanks
0 Comments   [ + ] Show Comments

Comments

Please log in to comment

Answers

2
the built in get script writes to X:  which is the ram drive in memory.  so a reboot- kiss that good bye

Set compNameFile = fso.CreateTextFile("X:\" & macAddress, True)

you would need to create a modifed get set pair of scripts that go to a mapped drive instead to keep this info.  I use windows shares to deploy my wims so I could write to the same share as the wims are stored. 
Answered 06/18/2014 by: SMal.tmcc
Red Belt

  • if you do this:
    if you have to rerun a machine you only need to use the apply computer name part, otherwise the get name would put garbage data in that folder.
  • Thanks. I ended up saving to the T:\ drive and checking if the file already existed.

    Here were my changes to the GetComputerName.vbs file

    'Dump the computer name into a file named as the mac address inside X:
    If fso.DriveExists("T:") then
    'Get mac adress
    Set objSysEnv = wshShell.Environment("PROCESS")
    macAddress = objSysEnv("MAC_ADDRESS")

    If fso.FileExists("T:\" & macAddress) Then
    WScript.Quit
    Else
    Set compNameFile = fso.CreateTextFile("T:\" & macAddress, True)
    End If

    Else
    usbDrive = fso.GetDriveName(wscript.ScriptFullName)
    Set compNameFile = fso.CreateTextFile(usbDrive & "\KACE\ComputerName", True)
    End If

    And the only thing I changed in the ApplyComputerName.vbs was the drive it looked for from X:\ to T:\
Please log in to comment
Answer this question or Comment on this question for clarity