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, certain service file was not installed with the correct instance.
In order to overcome this issue, a SAP GUI reinstallation is needed and a manual check on the service files available in %windir%\system32\drivers\etc . Also check the instance number in the SAP Logon Pad is the same as the service file.
Refer to the attached PDF to know the process of validating the SAP Instanace number with the Service file.