I have a new server and wish to upload icons from a previous server. I’m on Win10
I have gone to appdata>Roaming>TS3Client>cache>(correct server folder)>icons
However, all are blank and not png or other acceptable file types. I have tried opening up Powershell on the icon folder and running “cmd ren *. *.png” but there is no effect.
This is a pretty basic way of doing this because it relies on the image viewer to detect the actual image format (not all icons are pngs - there are also gif, jpg, svg).
To accommodate this you need a few more steps.
I had to modify the second script to make it work.
original here: Get-FileType.ps1 · GitHub
(The one above will not work - use the one below!)
Create a file containing the following code and name it Get-FileType.ps1
second script
function Get-FileType {
[CmdletBinding()]
param (
# Path to file.
[Parameter(Position = 0, ValueFromPipelineByPropertyName)]
[string[]] $Path
)
begin {
# description, hex signature, byte offset, byte limit
$fileSignatures = @(
@('JPG','FFD8FF',0,3),
@('PNG','89504E470D0A1A0A',0,8),
@('GIF','474946383761',0,6),
@('GIF','474946383961',0,6),
@('ICO','00000100',0,4),
@('SVG','3C',0,1)
)
}
process {
foreach ($filePath in $Path) {
if (Test-Path $Path) {
foreach($signature in $fileSignatures) {
if($thisSig = Get-FileSignature -Path $filePath -HexFilter $signature[1] -ByteOffset $signature[2] -ByteLimit $signature[3]) {
Write-Output $signature[0]
}
}
}
else {
Write-Warning "$filePath not found!"
}
}
}
}
open a powershell or cmd in the folder containing the images
allow powershell scripts by starting a new shell with correct execution policy: powershell -ExecutionPolicy Bypass
add the first script: Import-Module Drive:\path\to\Get-FileSignature.ps1
add the secondscript: Import-Module Drive:\path\to\Get-FileType.ps1