English | 简体中文
A Windows and PowerShell 7 tool for managing CS2 configuration files across Steam accounts. It also manages local practice-server cfg files as templates deployed to the CS2 game directory.
- Discovers local Steam accounts with CS2 configuration folders.
- Maps numeric Steam IDs to readable account aliases.
- Backs up, previews, copies, and restores account-level configuration.
- Merges selected settings from external cfg files by
Viewmodel,Video,Hud,Radar, andAudiocategories. - Imports, updates, and deploys local practice-server cfg templates.
- Supports
--what-if, automatic backups, and SHA-256 verification for write operations. - Excludes non-portable Steam Cloud, inventory, and
trustedlaunch.cfgstate by default.
The scripts have identical functionality. Their help, prompts, and errors are localized:
Cs2Config.zh-CN.ps1: Simplified ChineseCs2Config.en-US.ps1: English
Both scripts store runtime state relative to their own location in .tmp. Account aliases, templates, backups, and logs are not committed to Git.
CliFramework.ps1 is the shared command-path parser and help framework. Keep it in the same directory as either entry script.
- Use single-letter options for common inputs:
-aaccount,-ssource,-ttarget,-nname,-ppreset path,-csections,-bbackup,-iinclude custom cfg, and-hhelp. - Use lowercase kebab-case long options:
--account,--preset-path,--include-custom-cfg, and--what-if. - Less frequent inputs use their long form, such as
--new-name,--source-path,--config-path,--video-path, and--force.
- Windows
- PowerShell 7 or later
- Steam and Counter-Strike 2 installed
List available accounts with the English script:
Cs2Config.en-US.ps1 account listSet an account alias (the shorter account set form is also supported):
Cs2Config.en-US.ps1 `
account set -a 123456789 -n primaryBack up an account configuration:
Cs2Config.en-US.ps1 `
backup --account primary --include-custom-cfgPreview and then copy common settings from one account to another:
Cs2Config.en-US.ps1 `
apply -s primary -t secondary --what-if
Cs2Config.en-US.ps1 `
apply -s primary -t secondaryExternal autoexec.cfg files commonly contain bindings, sensitivity, crosshair, and personal settings. Use apply-preset to merge only the categories you choose:
Cs2Config.en-US.ps1 `
apply-preset `
--account primary `
--preset-path C:\Users\you\Downloads\autoexec.cfg `
--sections Viewmodel,Video,Hud,Radar,Audio `
--what-ifReview the preview, then remove --what-if to apply it. Unselected categories such as bindings, crosshair, and sensitivity are not changed.
If you have a separate cs2_video.txt, provide it with --video-path. Recognized video settings are merged without replacing GPU device IDs, monitor index, or refresh rate.
Practice cfg files are not account-level files. When you run exec <name>, CS2 resolves cfg files from the game installation directory, so a deployed practice template is shared by local accounts.
# Import an existing cfg as a template
Cs2Config.en-US.ps1 `
practice template import `
-n practice `
--source-path C:\Users\you\Downloads\practice.cfg
# Deploy it to the CS2 game directory
Cs2Config.en-US.ps1 `
practice apply -n practiceOn a local server, open the CS2 console and run:
exec practice
When importing a template from an account configuration, --config-path practice also matches practice.cfg; an explicitly supplied extension is preserved.
Commands that write settings refuse to run while cs2.exe is active. Before writing, the script creates a backup with manifest.json and SHA-256 hashes in .tmp\backups; operation summaries go to .tmp\logs.
The following are excluded from account copying by default:
trustedlaunch.cfg*_lastcloudedremote\remotecache.vdfsocache.dt
List backups and preview a restore before making a change:
Cs2Config.en-US.ps1 backup list -a primary
Cs2Config.en-US.ps1 restore -a primary -b <backup-directory-name> --what-ifRun either script without arguments, or append --help, for a concise command overview:
Cs2Config.en-US.ps1
Cs2Config.en-US.ps1 --helpHelp is available at every command level, including deep command paths:
Cs2Config.en-US.ps1 account set --help
Cs2Config.en-US.ps1 help practice template importUse PowerShell help for the full reference and examples:
Get-Help Cs2Config.en-US.ps1 -Full
Get-Help Cs2Config.zh-CN.ps1 -Examples