windowsbatch-filesvnwindows-servervisualsvn-server

Start and Stop VisualSVN Server batch


how can stop and start a VisualSVN Server via batch/console (windows) command?

My Setup:


Solution

  • VisualSVN Server 3.2 has 3 Windows services and each of them has to be stopped separatly:

    Some examples below.


    Using VisualSVN Server's WMI provider (via PowerShell):

    Start HTTP service:

    $service = Get-CimInstance -Namespace root\VisualSVN -ClassName VisualSVN_Service -Filter "Name = 'VisualSVNServer'"
    Invoke-CimMethod -InputObject $service -MethodName StartService
    

    Stop HTTP service:

    $service = Get-CimInstance -Namespace root\VisualSVN -ClassName VisualSVN_Service -Filter "Name = 'VisualSVNServer'"
    Invoke-CimMethod -InputObject $service -MethodName StopService
    

    Using SC.exe from cmd.exe command prompt:

    Stop VisualSVN Server's HTTP service: sc stop VisualSVNServer,

    Start VisualSVN Server's HTTP service: sc start VisualSVNServer.

    TechNet | sc command-line reference.