generated from dopt-python/py311
fix startup script
This commit is contained in:
@@ -1,13 +1,17 @@
|
||||
Set WshShell = CreateObject("WScript.Shell")
|
||||
Set FSO = CreateObject("Scripting.FileSystemObject")
|
||||
|
||||
strScriptDir = FSO.GetParentFolderName(WScript.ScriptFullName)
|
||||
WshShell.CurrentDirectory = strScriptDir
|
||||
' 1. Get the exact path to the python_env folder
|
||||
strEnvDir = FSO.GetParentFolderName(WScript.ScriptFullName) & "\python"
|
||||
|
||||
pythonExe = strScriptDir & "\python\python.exe"
|
||||
' 2. Set the working directory (crucial so pythonw.exe finds its DLLs)
|
||||
WshShell.CurrentDirectory = strEnvDir
|
||||
|
||||
' Use cmd.exe /c (close when done) as a trusted bridge to launch the module
|
||||
runCommand = "cmd.exe /c " & Chr(34) & pythonExe & Chr(34) & " -m wce_crm.gui"
|
||||
' 3. Get the ABSOLUTE path to the executable, not just the file name
|
||||
pythonExe = strEnvDir & "\pythonw.exe"
|
||||
|
||||
' Set back to 0 (Hidden).
|
||||
' 4. Build the command using the absolute path
|
||||
runCommand = Chr(34) & pythonExe & Chr(34) & " -m wce_crm.gui"
|
||||
|
||||
' 5. Run it completely hidden
|
||||
WshShell.Run runCommand, 0, False
|
||||
Reference in New Issue
Block a user