2 Dim sInstallDirectory ' The install directory of the simulator Simgrid
3 Dim sCurrentDirectory ' The current directory of the script
4 Dim sCommandLine ' The command line of the application to launch
5 Dim iExitCode ' The exit code of the application to launch
7 Set oShell = WScript.CreateObject ("WSCript.shell")
8 Set oUseEnv = oShell.Environment("USER")
10 ' Get the install directory of Simgrid from the environment variable SG_INSTALL_DIR
11 sInstallDirectory = oUseEnv("SG_INSTALL_DIR")
12 sCurrentDirectory = GetCurrentDirectory()
13 ' Construct the command line of the application to launch
14 sCommandLine = "cmd /K " & sCurrentDirectory & "bin\ping_simulator " & sInstallDirectory & "\simgrid\examples\msg\small_platform.xml " & sCurrentDirectory & "ping.xml"
16 iRetVal = oShell.run(sCommandLine,1,True)
19 Set oWshShell = Nothing
21 ' This function returns the directory of the script
22 Function GetCurrentDirectory()
25 sScriptFullName = WScript.ScriptFullName
26 GetCurrentDirectory = mid(sScriptFullName,1,InStrRev(sScriptFullName,"\"))