Example: Script for Starting the R/3 System 

@rem echo off

REM

REM substitute following strings:

REM string to subst substitution value typical values

REM <sapsid> SAP R/3 System name, e.g., C11 case sensitive

REM <central> your central host's host name

REM <app> your applications server's host name

REM <instance> the instance name, e.g., DVEBMGS00

REM <instance1> the app server's instance name, e.g., D00

REM <no> the central system's SAPSYSTEM, e.g., 00

REM <no1> the app server's SAPSYSTEM, e.g., 00

REM

REM for your values see the definitions in the profiles.

REM all profile names and values including the hostnames are cASeSenSiTivE!!!

REM

 

REM check the users which will definitely not work

if %USERNAME% == "SYSTEM" goto bad_user

 

REM first check existence of environment setup file

if not exist <sapsid>env.cmd \\<central>\sapmnt\<sapsid>\sys\exe\run\ntreg2cmd <sapsid>

 

REM setup the environment for the process so that he is able to

REM run also from poor telnet daemons and Schedule Service

call <sapsid>env.cmd

 

REM STARTUP FOLLOWING

 

REM DATABASE startup (not necessary, normally done through

REM service) for example sapdba -startup

sapdba -startup

 

REM start central instance service here...

ntscmgr start SAP<sapsid>_<no> -m <central>

 

REM you may also want to start additional application server services here...

REM if so use : ntscmgr start SAP<sapsid>_<no1> -m <app>

 

REM if Autostart=1 is specified in the startup_profile you need

REM not to execute the next two lines

 

REM start the central instance

sapstart pf=\\<central>\sapmnt\<sapsid>\sys\profile\start_<instance>_<central> SAPDIAHOST=<central>

 

REM you may want to startup additional application servers here...

REM if so use : sapstart pf=\\<central>\sapmnt\<sapsid>\sys\profile\start_<instance1>_<app> SAPDIAHOST=<app>

 

goto finito

 

REM ERROR_HANDLING

 

:bad_user

echo this batchfile (NTstartR3andDB) will not run under user %USERNAME% >\batcherr.err

echo please configure the Schedule Service to run under <sapsid>adm >> \batcherr.err

:finito