Set shell = CreateObject("WScript.Shell")
Set fso = CreateObject("Scripting.FileSystemObject")

atalhosDir = fso.GetParentFolderName(WScript.ScriptFullName)
baseDir = fso.GetParentFolderName(atalhosDir)
pythonw = baseDir & "\.venv\Scripts\pythonw.exe"
python = baseDir & "\.venv\Scripts\python.exe"
app = baseDir & "\web_app.py"

If fso.FileExists(pythonw) Then
  exe = pythonw
ElseIf fso.FileExists(python) Then
  exe = python
Else
  exe = "pythonw"
End If

shell.CurrentDirectory = baseDir
shell.Run """" & exe & """ """ & app & """", 0, False
