8

I am trying to login through SAP system through the command line using the SAP GUI command, is this possible? Is there a way to view all the arguments/parameters for the SAP GUI command?

Boghyon Hoffmann
  • 17,103
  • 12
  • 72
  • 170
rusty009
  • 836
  • 7
  • 16
  • 30

1 Answers1

19

You can use the sapshcut.exe to connect to a SAP system via command line. Here is an example:

sapshcut.exe -system=SID -client=100 -user=YOURUNAME -pw=Y0urP4$$

Further command line options are described in SAPNote 103019 (link requires a SAP service marketplace account) or can be obtained with the command

sapshcut.exe -help
Philipp
  • 67,764
  • 9
  • 118
  • 153
  • 1
    Thank you, it worked :). For anyone who would also like to do something similar, you will find that you get an annoying security message popping up asking if you want to allow CMD logging you in. To get rid of this you need to create a DWORD32 in the registry folder [HKEY_LOCAL_MACHINE\Software\SAP\SAPGUI Front\SAP Frontend Server\Security] and set it to 0 to deactivate security mode. – rusty009 May 30 '13 at 17:53
  • The name of the DWORD32 is SecurityLevel. On 64 bit, the registry key needs an additional Wow6432Node (`HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\SAP\SAPGUI Front\SAP Frontend Server\Security`) – Thomas Weller Jan 23 '15 at 09:26
  • You can use this command: sapgui in SAP Logon window, where you have all the systems listed, right click a system and go to "Properties...", find the values for "Message Server" and "Instance Number" there. – John Jiang Sep 26 '17 at 21:24
  • You can use this command: sapgui To find values for "message server" and "instance number", in SAP Logon window, where you have all the systems listed, right click a system and go to "Properties...", find the values for "Message Server" and "Instance Number" there. – John Jiang Sep 26 '17 at 21:25
  • 1
    I was using the `sapshcut.exe` method for a few years and today there is a message that does not allow me to logon; *Not all data for the SAP GUI shortcut is available. System Description and GUI Start parameter are unknown. Enter missing data.* I entered the parameters, but no luck so far. – JoeFletch Mar 11 '21 at 19:19