Starting and Stopping the Perforce Server on Windows

TASK

How do I start and stop the Perforce server on Windows?


SOLUTION

Perforce Servers at Release 99.2 and later can be stopped by a super user with:

p4 admin stop

Perforce Servers which are pre-99.2 can use the methods listed below to start and stop the server.

Starting the Perforce service from the Services dialog

If the Perforce Server is installed as a Windows service, a user with Administrator privileges can start and stop it using the Services dialog in the Control Panel. The Perforce service is usually installed by running the Perforce Server Windows Installer, available from the Perforce for Windows page.

To start the Perforce service:
  1. Context-click on "My Computer", and select "Manage". The "Computer Management" window is displayed.
  2. In the right hand pane, double click on "Services and Applications".
  3. Double click on "Services". You now have a list of available Windows services.
  4. Scroll down until you see the "Perforce" service. Right click on this item and select "Start".

Starting the Perforce server manually

The Perforce Server can also be started manually by any user from an MS-DOS window. The server executable, p4d.exe, is normally found in your P4ROOT directory. To start the server, first make sure your current P4ROOT, P4PORT, P4LOG, and P4JOURNAL settings are correct, then run:

%P4ROOT%\p4d

If you want to start a server using settings different than those set by P4ROOT, P4PORT, P4LOG, or P4JOURNAL, you can use p4d command line flags. For example:

%P4ROOT%\p4d -r %P4ROOT% -p 1999 -L %P4ROOT%\log

Stopping the Perforce service from the Services dialog

To stop the Perforce service, follow the same steps as starting the service. When you context-click on the Perforce service, select "Stop".

Stopping the Perforce server manually

To stop the server, type Ctrl-C in the MS-DOS window in which you started the Perforce server, or close the MS-DOS window.

Note:
Case (upper vs. lower) is significant for p4d command line flags.

If an error occurs when starting the Perforce service or the service fails to start (the "status" column in the computer management screen remains blank), check the Perforce log to determine the cause.

For more information please see the Perforce System Administrator's Guide.