I have a utility script that I build that is able to stop,start,restart services as well as stop, start, restart and ping any server. The paramaters are obviously passed in dynamically from the calling script.
The issue is, I have a peice of code that extracts the status of each service. In one environment, the process works flawlessly - no issues. But on my production box, this particular line of code fails, claiming \\<system name> is unexpected at this time:
Code: Select all
::-- Parse output of command and set STATE as a variable for script processing --::
FOR /f "tokens=4" %%S IN ('%PSSERVICE% \\%SYSTEMNAME% query "%SERVICENAME%" ^| FIND "STATE"') DO SET "CURRENT_STATUS=%%S"
Code: Select all
SET PSUser=Domain\srvc-hypadmin
SET PSPass=J72Dppsssas)
SET PSSERVICE=C:\ESSBASE_BATCH\Utilities\PSTools\PsService.exe -u %PSUser% -p %PSPass%
And then the system and services are passed in as such:
::-- Set Servers --::
SET "FND_SRVR=10.51.2.70"
SET "ESSB_SRVR=10.51.2.71"
echo ********************************************************
echo %ACTION% EPM Services on %FND_SRVR%
echo ********************************************************
FOR %%S IN (
"HyS9eas_epmsystem1"
"HyS9CALC_epmsystem1"
"HyS9EPMADataSynchronizer_epmsystem1"
"HyS9EPMAServer_epmsystem1"
"HyS9EPMAWebTier_epmsystem1"
"HyS9FRReports_epmsystem1"
"HyS9FoundationServices_epmsystem1"
"HyS9Planning_epmsystem1"
"HyS9RaFramework_epmsystem1"
"HyS9RaFrameworkAgent_epmsystem1"
"HyS9RMIRegistry_epmsystem1"
"OracleProcessManager_ohsInstance3250625901" ) DO (
CALL SafeStopStartRestart.cmd "%ACTION%" "%%~S" "%FND_SRVR%" "%PLOGPATH%" "%PERRORPATH%"
)
Thanks!