Hello World,
So i am trying the command prompt to check for all If my SAP systems on windows servers are up and running or not,
so i made SAPSYSTEMS.txt file contain the hostname for all my sap systems each in a line,
then i made checkrfc.bat file with the code bellow :
@echo off
rem ======================================================================
rem Script: CheckRFC.BAT
rem It uses SAPINFO from the RFC-SDK (SAPGUI) to check an RFC destination.
rem It needs two parameters: 1. Hostname 2. Instance Number
rem A ping is sent to the host. If successful an RFC check is carried out.
rem ======================================================================
if “%2″==”" goto NoParameter
echo Pinging %1 …
ping %1 -n 2 | find /i “reply” >nul && goto CheckRFC
echo System does not exist on the network! & goto Bye
:CheckRFC
sapinfo ashost=%1 sysnr=%2 & if errorlevel 1 goto System_Down
echo —————————
echo System is up. RFC checks OK!
echo —————————
goto Bye
:System_Down
echo —————
echo System is down!
echo —————
goto Bye
:NoParameter
echo ———————————————
echo Syntax: checkrfc “hostname” “instance number”
echo Example: checkrfc mydev 00
echo ———————————————
:Bye
then i made checkallrfc.bat file with the code bellow :
FOR /F %%i in (SAPsystems.txt) do call checkrfc %%i 00
i didnt find the SAPINFO.exe in the SAP gui dir. so i downloaded one from the net with size 36KB and placed in in the same folder on Desktop that contain the .bat and .txt file.
now when i run checkallrfc.bat it opens a command windows and automaticlly close it in less than 2 sec
also if i try to run the checkrfc.bat file same thing happen.
can anyone help me to idintify this problem and its cause ?
Thanks In Advance
Regards.
Ahmed Salam.