How can I log on sap from vbs?
- User
How can I log on sap from vbs?
Assistant
Here is some VBS code to log on to SAP from a script:
vbscriptDim SapGuiAuto Set SapGuiAuto = GetObject("SAPGUI") SapGuiAuto.OpenConnection "System Name", True SapGuiAuto.SetScriptingEngine "VBSCRIPT" SapGuiAuto.Children(0).Children(0).SendVKey 0 'Enter username SapGuiAuto.SendKeys "username" SapGuiAuto.Children(0).Children(1).SetFocus SapGuiAuto.SendKeys "password" SapGuiAuto.SendVKey 0 'Hit Enter to log on MsgBox "Logged on to SAP!"The key steps:
- Get the SAPGUI object using GetObject
- Open a connection to the SAP system
- Set the scripting engine to VBScript
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.