on error resume next if wscript.arguments.count=0 then 'Nothing to do else CompName = trim(wscript.arguments(0)) end if if len(trim(CompName)) > 0 then Set sho = CreateObject("WScript.Shell") 'Must write to two places in registry ... sho.RegWrite "HKCU\Software\Microsoft\RegEdt32\" & CompName & "\", "" sho.RegWrite "HKCU\Software\Microsoft\RegEdt32\Settings\Registry", CompName, "REG_SZ" strExe = "c:\program files\common files\smsclictr\tools\regedt32.exe" sho.Run Chr(34) & strExe & Chr(34), 1, False 'Pause a few seconds to allow regedt32 to initiate the connection before cleanup & exit wscript.sleep 2000 'Clean up sho.RegDelete "HKCU\Software\Microsoft\RegEdt32\Settings\Registry" sho.RegDelete "HKCU\Software\Microsoft\RegEdt32\" & CompName & "\" end if wscript.quit