Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/ansys/workbench/core/launch_workbench.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,20 +49,20 @@ def _launch_server(self):
logging.warning("ANSYS installation not found. Assume the default location: " + install_path)
else:
logging.info("ANSYS installation found at: " + install_path)
exePath = os.path.join(install_path, "Framework", "bin", "Win64", "RunWB2.exe")
executable = os.path.join(install_path, "Framework", "bin", "Win64", "RunWB2.exe")
prefix = uuid.uuid4().hex
workdir_arg = ''
if self._server_workdir is not None:
workdir_arg = ",WorkingDirectory=\'" + self._server_workdir + "\'"
cmdLine = exePath + " -I -E \"StartServer(EnvironmentPrefix=\'" + prefix + "\'" + workdir_arg + ")\""
command = executable + " -I -E \"StartServer(EnvironmentPrefix=\'" + prefix + "\'" + workdir_arg + ")\""

process_startup_info = self._wmi_connection.Win32_ProcessStartup.new(ShowWindow=1)
process_id, result = self._wmi_connection.Win32_Process.Create(
CommandLine = cmdLine,
CommandLine = command,
ProcessStartupInformation = process_startup_info)

if result == 0:
logging.info("Workbench launched on the host with process id " + str(process_id))
logging.info("Workbench launched on the host with process id: " + str(process_id))
self._process_id = process_id
else:
logging.error("Workbench failed to launch on the host")
Expand Down