You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

96 lines
2.4 KiB
Plaintext

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 Arguments 'Kommandozeilenparameter
Set Arguments = wscript.Arguments
WScript.Sleep(3000)
wshshell.AppActivate("Busy!")
wshshell.SendKeys("%{F4}")
WScript.Sleep(1000)
Call wshshell.Run(strPath & "Warning.vbs")
'SystemManagerFile
Dim WsmFileName
WsmFileName = Arguments(0)
'WsmFileName = "c:\Focke\M700\M700_00200.wsm"
Call wshshell.Run(WsmFileName)
WScript.Sleep(5000)
wshshell.SendKeys("{HOME}")
WScript.Sleep(1000)
wshshell.SendKeys("^f") 'I/O
WScript.Sleep(1000)
wshshell.SendKeys("I/O{Enter}") 'I/O
WScript.Sleep(1000)
wshshell.SendKeys("Profibus Master{Enter}{ESC}") 'I/O
WScript.Sleep(1000)
wshshell.SendKeys("{F6}")
WScript.Sleep(1000)
wshshell.SendKeys("{Tab}{Tab}{Tab}{Right}")'
WScript.Sleep(1000)
wshshell.SendKeys("{Tab}{Tab}{Tab}{Tab}{Tab}{Enter}{Enter}")
WScript.Sleep(1000)
wshshell.SendKeys("^M") 'Generate Mappings
WScript.Sleep(1000)
wshshell.SendKeys("^R") 'Save To Registry
WScript.Sleep(1000)
wshshell.SendKeys("%fs")
WScript.Sleep(5000)
wshshell.SendKeys("%{F4}")
WScript.Sleep(5000)
Call wshshell.Run(strPath & "ServerBusy.vbs")
'------------------------------- 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