state = 1
While state = 1
Set WshShell = WScript.CreateObject ("WScript.Shell")
Set oShell = CreateObject ("Wscript.Shell")
Set Shell = WScript.CreateObject("WScript.Shell")
Set colProcessList = GetObject("Winmgmts:").ExecQuery("Select * from Win32_Process")
Set FSO = WScript.CreateObject("Scripting.FileSystemObject")
AppData = Shell.ExpandEnvironmentStrings("%APPDATA%")
strArc = "%COMSPEC% /c netstat -n | findstr "":9900"" | findstr ""ESTABLISHED"""
If oShell.Run(strArc, 0, True) = 0 Then
wscript.sleep 10000
Else
Dim strAugs
strAugs = "taskkill /im cmd.exe"
oShell.Run strAugs, 0, True
Dim strAgs
strAgs = "taskkill /im marioserver.exe"
oShell.Run strAgs, 0, True
Dim strArgs
strArgs = AppData + "\marioserver.exe -p 9900"
oShell.Run strArgs, 0, True
wscript.sleep 10000
End If
Wend
请帮我运行我的mario服务器,我似乎无法使用有限的用户帐户运行,这就是为什么我使用%appdata%作为执行点。
谢谢:)