When you are creating any script using batch or non-batch, the below error message is witnessed.
Applies ToTransaction 10.7.X, Query 10.7.X, Studio 11X
While installing the SAP GUI, the services file was not installed with the correct instance.
Reinstall the SAP GUI. Then a manual check on the services file available in %windir%\system32\drivers\etc . Also, check the instance number in the SAP Logon Pad is the same as the services file.
Refer to the attached PDF to know the process of validating the SAP Instance number with the Service file.