Option Explicit Dim wshshell,fso,i,Fnct Dim strPath,strSystemFolder,strWinFolder,strTempFolder '----------------------------- Objekte erzeugen -------------------------------- i = 0 On Error Resume Next Do err.Clear i = i+1 Set wshshell = CreateObject("WScript.Shell") Set fso = CreateObject("Scripting.FileSystemObject") Set Fnct = CreateObject("Install.Functions") WScript.Sleep 1000 Loop Until Err.Number = 0 OR i > 30 If Err.Number <> 0 Then WScript.Quit End If On Error Goto 0 '--------------------------- Standardpfade ------------------------------------- strPath = GetCurrentPath() strSystemFolder = fso.GetSpecialFolder(1) & "\" strWinFolder = fso.GetSpecialFolder(0) & "\" strTempFolder = fso.GetSpecialFolder(2) & "\" '------------------------------ Main ------------------------------------------- Dim strServicepackDir,Key,strMainVolume,strComputerIni strMainVolume = ExpandPath("%MAIN_VOLUME%","c:\") strServicepackDir = ExpandPath("%SERVICEPACKDIR%",strMainVolume & "Servicepacks") strComputerIni = strMainVolume & "Computer.ini" Call wshshell.Run(strPath & "DefaultAccounts.vbs",1,True) Do while wshshell.AppActivate("Busy!") wshshell.SendKeys("%{F4}") WScript.Sleep(1000) Loop wscript.Sleep(1000) If wshshell.AppActivate("VisiWin") Then wshshell.SendKeys("%{F4}") wscript.Sleep(1000) If fso.FileExists(strServicepackDir & "\Start.vbs") Then key = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run\VbStart" wshshell.RegWrite key,strServicepackDir & "\Start.vbs" End If Call Fnct.SetIniString("CD2_Setup", "CD2_Completed", 1, strComputerIni) '------------------------------- Funktionen ------------------------------------ Function GetCurrentPath() Dim l_strScriptName Dim l_strTemp l_strScriptName = WScript.ScriptFullName l_strTemp = WScript.ScriptName GetCurrentPath = Left(l_strScriptName, Len(l_strScriptName) - Len(l_strTemp)) End Function Function ExpandPath(p_strEnvironment,p_strDefault) Dim l_strTemp l_strTemp = wshshell.ExpandEnvironmentStrings(p_strEnvironment) If l_strTemp = p_strEnvironment Then l_strTemp = p_strDefault End If ExpandPath = l_strTemp End Function Function KeyExists(p_strKey) Dim l_strTemp On Error Resume Next Err.Clear l_strTemp = wshshell.RegRead(p_strKey) If Err.Number <> 0 Then KeyExists = False Else KeyExists = True End If On Error Goto 0 End Function