Connection Client Generator - Command Line Reference
ClientGenerator.exe supports two silent command-line modes:
- Generation mode — creates a new
.connectclient file from scratch. - Edit mode (
-edit) — edits an existing.connectfile and writes the result to a new file.
The mode is selected automatically based on whether the -edit flag is present.
Generation mode
Creates a new .connect client file.
Syntax
ClientGenerator.exe -name "clientname.connect" [-location "output folder"] -server my.server.com -user login -psw password [...]Parameters
| Parameter | Required | Description |
|---|---|---|
-name | No | Name of the generated .connect file. Defaults to Client-<timestamp>.connect if omitted. |
-location | No | Folder where the file is generated. Defaults to the current user’s Desktop. |
| (all other parameters) | Depends | Forwarded as-is to the client generation logic (-server, -user, -psw, etc.). |
Example
ClientGenerator.exe -name "clientname.connect" -server my.server.com -server 127.0.0.1 -user login -psw passwordEdit mode
Edits an existing .connect file (input) and writes the modified result to a new .connect file (output). Requires the -edit flag.
Syntax
ClientGenerator.exe -edit -path "input file path" -output "output file path" [-user user] [-psw psw] [-domain domain] [-mode remoteapp|remotedesktop]Parameters
| Parameter | Required | Description |
|---|---|---|
-edit | Yes | Enables edit mode. |
-path | Yes | Path to the input .connect file. Must end with .connect. |
-output | Yes | Path to the output .connect file. Must end with .connect. |
-user | At least one of -user, -psw, -domain, -mode is required | New username value. |
-psw | See above | New password value. |
-domain | See above | New domain value. |
-mode | See above | Connection mode. Must be remoteapp or remotedesktop. |
Example
ClientGenerator.exe -edit -path "C:\Clients\template.connect" -output "C:\Clients\output.connect" -user jdoe -mode remoteappExit codes
| Code | Meaning |
|---|---|
0 | Operation completed successfully. |
| Non-zero | Operation completed with errors — see console output for details. |
1 | Invalid or missing command-line arguments. |
PowerShell usage examples
Generate a single client
& ".\ClientGenerator.exe" -name "clientname.connect" -server "my.server.com" -user "login" -psw "password"Generate multiple clients in a loop (from a CSV list)
Given a clients.csv file:
Name,Server,User,Passwordmarie.connect,srv01.company.com,marie,P@ssw0rd1edgar.connect,srv02.company.com,edgar,P@ssw0rd2rose.connect,srv03.company.com,rose,P@ssw0rd3$clients = Import-Csv -Path ".\clients.csv"
foreach ($client in $clients) { Write-Host "Generating client: $($client.Name)"
& ".\ClientGenerator.exe" ` -name $client.Name ` -server $client.Server ` -user $client.User ` -psw $client.Password
if ($LASTEXITCODE -ne 0) { Write-Warning "Generation failed for $($client.Name) (exit code $LASTEXITCODE)" }}Generate clients for a range of usernames
$server = "my.server.com"
1..10 | ForEach-Object { $user = "user{0:D2}" -f $_ $name = "$user.connect"
Write-Host "Generating client for $user..."
& ".\ClientGenerator.exe" -name $name -server $server -user $user -psw "TempP@ss123"}Edit multiple existing .connect files in a loop
Applies the same domain and mode update to every .connect file in a folder.
$inputFolder = "C:\Clients\ToUpdate"$outputFolder = "C:\Clients\Updated"
New-Item -ItemType Directory -Path $outputFolder -Force | Out-Null
Get-ChildItem -Path $inputFolder -Filter "*.connect" | ForEach-Object { $outputPath = Join-Path $outputFolder $_.Name
Write-Host "Editing: $($_.Name)"
& ".\ClientGenerator.exe" ` -edit ` -path $_.FullName ` -output $outputPath ` -domain "CORP" ` -mode "remoteapp"
if ($LASTEXITCODE -eq 0) { Write-Host " -> Success" -ForegroundColor Green } else { Write-Warning " -> Failed (exit code $LASTEXITCODE)" }}Edit clients with per-file settings (from CSV)
Given an edits.csv file:
InputPath,OutputPath,User,ModeC:\Clients\a.connect,C:\Clients\a-updated.connect,alice,remoteappC:\Clients\b.connect,C:\Clients\b-updated.connect,bob,remotedesktop$edits = Import-Csv -Path ".\edits.csv"
foreach ($edit in $edits) { & ".\ClientGenerator.exe" ` -edit ` -path $edit.InputPath ` -output $edit.OutputPath ` -user $edit.User ` -mode $edit.Mode
if ($LASTEXITCODE -ne 0) { Write-Warning "Failed to edit $($edit.InputPath)" }}Note:
$LASTEXITCODEis only reliable immediately after a native executable call. Avoid running other commands between theClientGenerator.execall and the check.