Command & Conquer: Tiberian Sun

From LANCommander
Revision as of 07:01, 31 July 2023 by DoctorDalek (talk | contribs) (Created page with "Category:Games {{Game.InfoBox |Cover = cover.jpg |Release Date = {{Game.InfoBox.ReleaseDate|Windows|August 20, 1999}} | PCGamingWiki = Command_%26_Conquer:_Tiberian_Sun }} {{Game.ActionBox |Actions = {{Game.ActionBox.Row|Name = Play|Path = TSMPLauncher.exe|Arguments = |WorkingDirectory = |Primary = True}} }} {{Game.Scripts.NameChange |Name = Name Change Script |Description = |RequiresAdmin = False |Contents = <syntaxhighlight lang="powershell" line> $NewName = $a...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Release Date
Windows: August 20, 1999
View at PCGamingWiki

Actions

Name Path Arguments Working Directory Primary
Play TSMPLauncher.exe True

Name Change Script

$NewName = $args[0]
$InstallDir = $PSScriptRoot

function Write-ReplaceContentInFile([string]$Regex, [string]$Replacement, [string]$FilePath)
{
    $content = (Get-Content $FilePath) -replace $Regex, $Replacement
    [IO.File]::WriteAllLines($FilePath, $content)
}

Write-ReplaceContentInFile -Regex '^Nickname=(.+)' -Replacement "Nickname=$NewName" -FilePath "$InstallDir\cncnet5.ini"