I donβt even know where to start with my question, I tried a hundred things and worked for several hours, but did not find anything useful. (I am open to every trick.)
Here is my problem:
I have a .hta combo file that looks like this:

It lists all the sessions / modifications of my SAP Gui.
Set SapGuiAuto = GetObject("SAPGUI") Set application = SapGuiAuto.GetScriptingEngine If application.Connections.Count > 0 Then Set connection = application.Children(0) If connection.Sessions.Count > 0 Then Set session = connection.Children(0) End If End If If IsObject(WScript) Then WScript.ConnectObject session, "on" WScript.ConnectObject application, "on" End If Set optGroup = Document.createElement("OPTGROUP") optGroup.label = "Server" 'count all connected servers ConnectionCount = application.Connections.Count If ConnectionCount > 0 Then Sessionlist.appendChild(optGroup) Else optGroup.label = "No connection here." End If 'count all sessions per server If ConnectionCount > 0 Then For Each conn in application.Connections 'Text output connections and sessions SessionCount = conn.Sessions.Count whatIsIt = conn.Description ConnectionFeld.innerhtml = ConnectionFeld.innerhtml & " <br> " & SessionCount & " Sessions auf " & whatIsIt 'fill listbox with all connections Set objOption = nothing Set optGroup = Document.createElement("OPTGROUP") optGroup.label = conn.Description Sessionlist.appendChild(optGroup) i = 0 'fill listbox with all sessions For Each sess In conn.Sessions i = i + 1 Set objOption = Document.createElement("OPTION") objOption.Text = "Session " & i & ": " & sess.ID objOption.Value = sess.ID SessionList.options.add(objOption) Next Next Else Exit Sub End If
My goal: if I double-click on one of the entries in this list, the selected instance of my SAP Gui should go to the forefront / activate.
Unfortunately, my task manager displays only one task, and this is "SAP Logon". One of my open windows also has the name "SAP Logon", all the others have the same name: "SAP Easy Access".

The only way to see connection identifiers (server name) and session identifiers is to extract them using vbscript. (see above)
Is there any way to do this? The only workarounds that I could come up with after a few thousand solutions are the following two:
extremely ugly workaround:
If sessionID = sess.ID Then Set objShell = CreateObject("shell.application") objShell.MinimizeAll sess.findById("wnd[0]").maximize End If
It minimizes all windows and then maximizes the selected SAP window. Unfortunately, my HTA-GUI is also minimized, which kinda sucks.
Second idea:
Somehow get to these clickable thingies by shortcut and put this in my script or some other ugly way.
By hand you need to do this:
Click on this little arrow, right-click on the icon, and then left-click on the name.

Is there a way to automate this? It drives me crazy.
Hope someone can help me, this would be STRONGLY appreciated.
PS: I'm sitting on a machine with limited rights, so I may not be able to solve this problem using the Windows API-ish solutions.
EDIT regarding comments:
It's impossible:
- modify registry entries
- create COM objects
- works with anything but VBScript