---
title: Manage OpenVPN Connect from the Command Line
canonical: https://openvpn.net/connect-docs/command-line-functionality-windows/
product: OpenVPN Connect Docs
---

# Manage OpenVPN Connect from the Command Line

We introduced support for the command-line interface (CLI) in OpenVPN Connect version 3.3 for [Microsoft Windows](https://openvpn.net/client-connect-vpn-for-windows/). Using a console on a supported operating system, you can use the CLI to manage most application functions. This document provides an overview of the commands you can use.

## Get Started

1. Open Command Prompt and navigate to the OpenVPN Connect installation directory:

   ```
   cd /d "C:\Program Files\OpenVPN Connect"
   ```
2. Run OpenVPN Connect CLI commands from that directory.

## Helpers

These commands won’t launch the application but are useful for gathering information from the terminal output.

### Commands available

```
--help
```

List all of the available commands with a short description.

```
Help:

--accept-gdpr  -  Accept GDPR for application usage
--hide-tray  -  Launch the application and hide tray icon
--minimize  -  Launch app in the background and UI window does not display
--quit  -  Quit the application
--list-settings  -  Show all application's setting values
--set-setting  -  Change any application setting
  Format:
    --set-setting=<name> --value=<value>
  Setting values (values in [] are default options):
    vpn-protocol: [adaptive]|tcp|udp
    timeout: 10|30|[60]|120|0
    launch-at-startup: [true]|false
    connect-on-launch: [true]|false
    seamless-tunnel: true|[false]
    minimize-on-launch: [true]|false
    captive-portal-detection: [true]|false
    software-update: [daily]|weekly|monthly|never
    theme: [system]|light|dark
    disconnect-confirmation: [true]|false
    security-level: preferred|[legacy]|insecure
    enforce-tls-1-3: true|[false]
    enable-dco: true|[false]
    block-ipv6: yes|[no]
    google-dns-fallback: [true]|false
    allow-local-dns: true|[false]
--skip-startup-dialogs  -  Close (skip) information dialogs that OpenVPN Connect shows during the first launch (onboarding tour, update changes, etc.)
--version  -  Show the application version
--list-profiles  -  Show list of profiles imported in the application
--import-profile  -  Import profile by path to a file. All parameters except path are optional and will be saved in the profile configuration
  Format:
    --import-profile=<path-to-profile> --name=<profile-name> --username=<username> --password=<password> --pkp=<private-key-password> --certificate=<cert-id>
--remove-profile  -  Remove profile by ID or profile name. ID has a higher priority
  Format:
    --remove-profile=<profile-id|profile-name>
--list-certificates  -  Show list of certificates imported into the application
--import-certificate  -  Import PKCS12 certificate/key pair (.p12) into the application. Password parameter is optional
  Format:
    --import-certificate=<path-to-pkcs12> --password=<password>
--remove-certificate  -  Remove certificate from the application storage
  Format:
    --remove-certificate=<cert-id>
--import-config  -  Apply app config file inside the application
  Format:
    --import-config=<path to ocfg file>"
```

### App version

```
--version
```

Displays the application version and build number.

```
{
 version: "3.2.3",
 build-number: "1900"
}
```

## Launch flags

These commands can launch OpenVPN Connect if it is not running, or can be executed on the running instance. They can be used together, in any order.

### Launch in background

```
--minimize
```

Launches the app in the background. The UI window won’t open.

### Hide tray icon

```
--hide-tray
```

Launches the application and hides the tray icon.

## Configuration

### Notifications

#### Accept GDPR consent

```
--accept-gdpr
```

Accepts the General Data Protection (GDPR) consent.

> **Note**
>
> After installation, if you start the application without this flag and haven’t previously accepted GDPR through the UI, OpenVPN Connect won’t function and won’t accept commands. Instead, you receive an error message.
>
> ```
> {
>  status: "error",
>  error: "Accept GDPR to use the application."
> }
> ```

#### Skip startup dialogs

```
--skip-startup-dialogs
```

Closes and dismisses the information dialogs that display at first launch of OpenVPN Connect. These dialogs include the onboarding tour and the list of recent changes. The next time the application UI launches, these dialogs won’t display.

> **Note**
>
> This flag doesn't skip the GDPR dialog.

### Profiles

#### List all profiles

```
--list-profiles
```

Displays the list of profiles that are imported into OpenVPN Connect. The information includes profile ID, profile name, hostname, type, username, and server override.

```
[{
 id: <profile-id>,
 name: <profile-name>,
 host: <hostname>,
 type: <autologin|user-locked|server-locked>,
 username: <username>,
 server-override: <hostname|none>
},
...
]
```

##### Import a profile

```
--import-profile=<path-to-the-profile> --name=<display-name> --username=<username> --password=<password> --pkp=<private-key-password> certificate=<cert-id>
```

Imports a profile from a file location, with the file path as a required parameter. All other parameters are optional, but if provided they are saved in the profile configuration. For example, a password can be used during connection for the specific profile. Also, you can pass these parameters in the UI for each connection.

If the import is successful, the command outputs the profile information.

```
{
 "message": {
   "id": "<profile-id>",
   "name": "<profile-name>",
   "host": "<hostname>",
   "type": "<autologin|user-locked|server-locked>",
   "username": "<username>",
   "server-override": "<hostname|none>"
 },
 "status": "success"
}
```

If unsuccessful, the command outputs an error message.

```
{
 "error": <error-message>,
 "status": "error"
}
```

##### Remove a profile

```
--remove-profile=<profile-id|profile-name>
```

Removes a profile using either the profile ID or profile name. The command line outputs either a success or error status message.

```
{
 "message|error": <Result of operation>,
 "status": "success|error"
}
```

### Certificates Management

#### List all certificates

```
--list-certificates
```

Displays the list of imported certificates. The output includes the cert ID, hash, expiration state, and a subject summary.

```
[{
 cert-id: <cert-id>,
 hash: <hash>,
 is-expired: true|false,
 subject-summary: <Subject Summary>
},
...
]
```

##### Import a certificate

```
--import-certificate=<path-to-certificate> --password=<password>
```

Imports the PKCS 12 certificate/key pair from a file location. The certificate saves in OS Certificate Storage or keychain. The file path is required, but the password is optional. The command output displays the cert ID, hash, expiration state, and a subject summary.

```
{
 "message": {
   "cert-id": <cert-id>,
   "hash": <hash>,
   "is-expired": true|false,
   "subject-summary": <Subject Summary>
 },
 "status": "success"
}
```

If the import fails, the command output displays an error message.

```
{
 "error": <error-message>,
 "status": "error"
}
```

##### Remove a certificate

```
--remove-certificate=<cert-id>
```

Removes a certificate by cert ID. The command line outputs either a success or error status message.

```
{
 "message|error": <Result of operation>,
 "status": "success|error"
}
```

### Settings Management

#### Import a global config file

```
--import-config=<path to .ocfg file>
```

Imports configurations from a file location, with the file path as a required parameter. If the import is successful, the command outputs the following message:

```
{
  "message": "The app config has been applied successfully.",
  "status": "success"
}
```

#### List all application setting values

```
--list-settings
```

Lists all of the application setting values, including protocol, timeout, startup options, seamless tunnel, and others.

```
{
  "allow-local-dns": false,
  "block-ipv6": "yes",
  "captive-portal-detection": true,
  "disconnect-confirmation": true,
  "enable-dco": false,
  "enforce-tls-1-3": false,
  "google-dns-fallback": true,
  "launch-at-startup": "true",
  "connect-on-launch": "true",
  "seamless-tunnel": false,
  "security-level": "legacy",
  "minimize-on-launch": true,
  "software-update": "daily",
  "theme": "system",
  "timeout": "60",
  "vpn-protocol": "adaptive"
}
```

#### Set a setting value

```
--set-setting=<name> --value=<value>
```

Changes any of the application settings. The command line outputs either a success or error status message.

```
{
 "message|error": <Result of operation>,
 "status": "success|error"
}
```

## Related resources

- [Windows Pre-Login Connect (PLC)](https://openvpn.net/connect-docs/windows-pre-login-connect-plc.md)
- [Global Configuration File Support for Windows](https://openvpn.net/connect-docs/windows-global-configuration-file-support.md)
- [Settings](https://openvpn.net/connect-docs/app-settings-windows.md)
- [Frequently Asked Questions](https://openvpn.net/connect-docs/windows-faq.md)

---

Prev: [OpenVPN DCO](https://openvpn.net/connect-docs/openvpn-dco.md)
Next: [Global Config](https://openvpn.net/connect-docs/windows-global-configuration-file-support.md)
Index: https://openvpn.net/connect-docs/llms.txt
