Hello Stefan,
Thank you for the tips.
I did create the shortcut with right click >> new >> Sap GUI Shortcut.
Yes, I would like to avoid opening SAP Logon to have the benefits of the shortcut Image may be NSFW.
Clik here to view.
Regarding the first option, to use 64-bit WSH, did not work. I got exactly the same error message.
c:\Windows\SysWOW64\wscript.exe c:\temp\Script5.vbs
Then I tried also the 32-bit WSH - same error.
c:\Windows\System32\wscript.exe c:\temp\Script5.vbs
The other option, to use the method OpenConnectionByConnectionString worked, it got a new instance of SAP Gui and start to interact with the script.
However, it did not use the current open connection/session, I was prompted again with username and password to a new login on the same environment.
Is there a way of accessing current connection instead of opening a new one? I had a look on the GuiApplication object and did not find it.
Regards
Darley