<p>What is the command-line equivalent of "Switch Port Client User" as found in the p4win gui client? </p>

<p>I am already logged under one port but now I am attempting to connect to a different port on the same server in order to access a separate source control file depot. I assume it would involve using:</p>

<pre><code>p4 login
</code></pre>

<p>However, reading the 'help' for 'login' does not show an option to specify the port #. Both user name and client name would remain the same but just need to change the port #.</p>

The P4PORT configuration variable stores the Perforce server name and port number to connect to. You can set this value as an environment variable or, if you're using Windows, in the registry using 'p4 set':
```
```
p4 set P4PORT=perforce:1669
```
```
To see what the current value of P4PORT is:
```
```
> p4 set P4PORT
P4PORT=perforce:1669
```
```