Previous Table of Contents Index Next
Perforce 2009.1: Command Reference



p4 set
Synopsis
Set Perforce variables in the Windows registry.
Syntax
p4 [g-opts] set [ -s ] [ -S svcname ] [ var=[value] ]
Description
The Perforce client and server require the use of certain system variables.
On Windows, you can set the values of these variables in the registry with p4 set; on other operating systems, Perforce uses environment variables for the same purpose.
To set the value of a registry variable for the current user, use p4 set var=value. Windows administrators can use p4 set -s var=value to set the registry variable's default values for all users on the local machine.
Windows administrators running the Perforce server as a service can set variables used by the service (for instance, P4JOURNAL and others) with p4 set -S svcname var=value.
To unset the value for a particular variable, leave value empty.
To view a list of the values of all Perforce variables, use p4 set without any arguments. On UNIX, this displays the values of the associated environment variables. On Windows, this displays either the MS-DOS environment variable (if set), or the value in the registry and whether it was defined with p4 set (for the current user) or p4 set -s (for the local machine).
p4 set can be used on non-Windows operating systems to view the values of variables, but if you try to use p4 set to set variables on non-Windows operating systems, Perforce will display an error message.
Options
Without this flag, p4 set sets the variables in the HKEY_CURRENT_USER hive; when you use the -s flag, the variables are set in the HKEY_LOCAL_MACHINE hive.
-S svcname
Set the value of the registry variables as used by service svcname. You must have administrator privileges to do this.
Usage Notes
Can File Arguments Use
Revision Specifier?
Changes to registry values under Windows affect the local machine only; an administrator setting P4JOURNAL for a Perforce Windows service must be present at the machine running the service.
Values within P4CONFIG files have precedence over both of these;
The global option flags have the highest precedence.
If you're working in a UNIX-like environment on a Windows machine (e.g. Cygwin), use environment variables instead of p4 set. (In such cases, the Perforce Command-Line Client behaves just as though it were in a UNIX environment.)
Examples
On all platforms, display a list of Perforce variables without changing their values.
On Windows, set a registry variable telling Perforce client programs to connect to a Perforce server at host tea, port 1666.
Set P4PORT as above, but for all users on the system.
For the NT service p4svc, instruct p4s.exe to listen on port 1666 for incoming connections from Perforce client programs.
p4 set
P4EDITOR="C:\File Editor\editor.exe"
On Windows, for the current local user, set the path for the default text editor.
The presence of spaces in the path to the editor's executable requires that the path be enclosed in quotation marks.


Previous Table of Contents Index Next

Perforce 2009.1: Command Reference
Copyright 1999-2009 Perforce Software.