(PeteCresswell)
2015-12-27 16:37:01 UTC
I want to delete a bunch of IP cam output files, but do not want the
.BAT file to hang for such a long time because the cam server
has some files IN USE.
So I want to stop the service, delete the files, and then
re-start the service.
I do not want the service to start automagically while the
delete are in progress.
viz:
===============================================================
sc stop BlueIris
sc config BlueIris start= disabled
ERASE B:\Alerts\*.* /Q
ERASE B:\Clips \*.* /Q
ERASE B:\Clips_Stored\*.* /Q
ERASE B:\DB\*.* /F /Q
sc start BlueIris
sc config BlueIris start= auto
ECHO OFF
ECHO .
ECHO .
ECHO . ------------ Done! -------------
ECHO .
ECHO .
PAUSE
==================================================================
It's almost working, but not quite.
According to "Services.msc", the BlueIris service is left in a
"Stopping" state and attempts to re-start it or go at it
via the SC command do not work.
viz:
==================================================================
C:\BAT>sc stop BlueIris
[SC] ControlService FAILED 1061:
The service cannot accept control messages at this time.
C:\BAT>sc config BlueIris start= disabled
[SC] ChangeServiceConfig SUCCESS
C:\BAT>ERASE B:\Alerts\*.* /Q
C:\BAT>ERASE B:\Clips \*.* /Q
C:\BAT>ERASE B:\Clips_Stored\*.* /Q
C:\BAT>ERASE B:\DB\*.* /F /Q
C:\BAT>sc start BlueIris
[SC] StartService FAILED 1056:
An instance of the service is already running.
C:\BAT>sc config BlueIris start= auto
[SC] ChangeServiceConfig SUCCESS
C:\BAT>ECHO OFF
.
.
. ------------ Done! -------------
.
.
Press any key to continue . . .
==================================================================
Am I going at this the wrong way ?
.BAT file to hang for such a long time because the cam server
has some files IN USE.
So I want to stop the service, delete the files, and then
re-start the service.
I do not want the service to start automagically while the
delete are in progress.
viz:
===============================================================
sc stop BlueIris
sc config BlueIris start= disabled
ERASE B:\Alerts\*.* /Q
ERASE B:\Clips \*.* /Q
ERASE B:\Clips_Stored\*.* /Q
ERASE B:\DB\*.* /F /Q
sc start BlueIris
sc config BlueIris start= auto
ECHO OFF
ECHO .
ECHO .
ECHO . ------------ Done! -------------
ECHO .
ECHO .
PAUSE
==================================================================
It's almost working, but not quite.
According to "Services.msc", the BlueIris service is left in a
"Stopping" state and attempts to re-start it or go at it
via the SC command do not work.
viz:
==================================================================
C:\BAT>sc stop BlueIris
[SC] ControlService FAILED 1061:
The service cannot accept control messages at this time.
C:\BAT>sc config BlueIris start= disabled
[SC] ChangeServiceConfig SUCCESS
C:\BAT>ERASE B:\Alerts\*.* /Q
C:\BAT>ERASE B:\Clips \*.* /Q
C:\BAT>ERASE B:\Clips_Stored\*.* /Q
C:\BAT>ERASE B:\DB\*.* /F /Q
C:\BAT>sc start BlueIris
[SC] StartService FAILED 1056:
An instance of the service is already running.
C:\BAT>sc config BlueIris start= auto
[SC] ChangeServiceConfig SUCCESS
C:\BAT>ECHO OFF
.
.
. ------------ Done! -------------
.
.
Press any key to continue . . .
==================================================================
Am I going at this the wrong way ?
--
Pete Cresswell
Pete Cresswell