Hello everyone. I'm trying to create a vb scripted automatic imaging
with AD domain join. I'm running a set of three scripts as per Jim
Shank's coolsolutions article with some other modifications I've
picked up from this forum.

My 1strun.vbs script looks like this:

Option Explicit
Dim WshShell, oFso
Set WshShell=Wscript.CreateObject("Wscript.shell")
Set oFso = CreateObject("Scripting.FileSystemObject")
WshShell.LogEvent 0, "Post imaging scripting started"
if (oFso.FileExists("C:\sysinfo\debug.txt")) then
msgbox "Starting 1 "
end if

WshShell.LogEvent 0, WScript.ScriptName & " started"
WshShell.RegWrite "HKLM\SOFTWARE\Microsoft\Windows
"HKCU\Software\Microsoft\Windows\CurrentVersion\Ru nonce\2run","c:\windows\zmg\2ndrun.vbs"
"HKLM\Software\Microsoft\Windows\CurrentVersion\Po licies\Explorer\NoDesktop",1,"REG_DWORD"
'Clear out the current domain name so that there is no error on reboot
WshShell.RegWrite "HKLM\SOFTWARE\Microsoft\Windows
If (oFso.FileExists("C:\sysinfo\debug.txt")) then
WshShell.LogEvent 4, "Entering debug mode scripting"
msgbox "Pausing for debug 1"
end if
WshShell.LogEvent 0, WScript.ScriptName & " completed successfully"
WshShell.Run "ziswin -s"
MsgBox "Waiting for Ziswin to finish"

This works as expected. Ziswin runs and processes a name change on the
box (from the image name TEST to TEST1 as per image safe data). Ziswin
then restarts the box.

When the box comes back up, the second autoadmin login fails with the
dreaded "domain controller cannot be found". When I attempt a manual
login, the domain list on the windows tab has two values, the new name
(TEST1) and the old name (TEST). The login fails against the new name
but works fine against the old name.

This leads me to conclude that ziswin didn't successfully rename the
box. BTW, I have ziswin set to NOT restore the workgroup.

All suggestions welcome.