Create shortcut in Anf+hrungszeichen egesetzt damit sonderzeichnen erlaubt sind

This commit is contained in:
duffyduck 2025-12-22 15:52:07 +01:00
parent c369ee18e7
commit e52aab604c
2 changed files with 8 additions and 4 deletions

View File

@ -341,6 +341,10 @@ try {
$itemName = Split-Path -Path $Path -Leaf $itemName = Split-Path -Path $Path -Leaf
} }
# Ungueltige Zeichen fuer Dateinamen entfernen/ersetzen
# Verboten in Windows-Dateinamen: \ / : * ? " < > |
$itemName = $itemName -replace '[\\/:*?"<>|]', '_'
$shortcutPath = Join-Path $userFolder "$itemName.lnk" $shortcutPath = Join-Path $userFolder "$itemName.lnk"
$counter = 1 $counter = 1

View File

@ -164,9 +164,9 @@ function Install-ContextMenu {
} }
if ($shellType -eq "Directory\Background\shell") { if ($shellType -eq "Directory\Background\shell") {
Set-ItemProperty -Path $freigabeCmd -Name "(Default)" -Value "powershell.exe -ExecutionPolicy Bypass -WindowStyle Hidden -File `"$freigabeScript`" -Path `"%V`"" Set-ItemProperty -Path $freigabeCmd -Name "(Default)" -Value "powershell.exe -ExecutionPolicy Bypass -WindowStyle Hidden -File `"$freigabeScript`" -Path `"`"%V`"`""
} else { } else {
Set-ItemProperty -Path $freigabeCmd -Name "(Default)" -Value "powershell.exe -ExecutionPolicy Bypass -WindowStyle Hidden -File `"$freigabeScript`" -Path `"%1`"" Set-ItemProperty -Path $freigabeCmd -Name "(Default)" -Value "powershell.exe -ExecutionPolicy Bypass -WindowStyle Hidden -File `"$freigabeScript`" -Path `"`"%1`"`""
} }
if (-not (Test-Path $entfernenKey)) { if (-not (Test-Path $entfernenKey)) {
@ -181,9 +181,9 @@ function Install-ContextMenu {
} }
if ($shellType -eq "Directory\Background\shell") { if ($shellType -eq "Directory\Background\shell") {
Set-ItemProperty -Path $entfernenCmd -Name "(Default)" -Value "powershell.exe -ExecutionPolicy Bypass -WindowStyle Hidden -File `"$entfernenScript`" -Path `"%V`"" Set-ItemProperty -Path $entfernenCmd -Name "(Default)" -Value "powershell.exe -ExecutionPolicy Bypass -WindowStyle Hidden -File `"$entfernenScript`" -Path `"`"%V`"`""
} else { } else {
Set-ItemProperty -Path $entfernenCmd -Name "(Default)" -Value "powershell.exe -ExecutionPolicy Bypass -WindowStyle Hidden -File `"$entfernenScript`" -Path `"%1`"" Set-ItemProperty -Path $entfernenCmd -Name "(Default)" -Value "powershell.exe -ExecutionPolicy Bypass -WindowStyle Hidden -File `"$entfernenScript`" -Path `"`"%1`"`""
} }
} }