Jump to content

it-betrieb

Members
  • Gesamte Inhalte

    1
  • Registriert seit

  • Letzter Besuch

Alle erstellten Inhalte von it-betrieb

  1. Hallo Kollegen, ja das ist wohl von Microsoft nicht gewollt das auf einem session host die file assoziations funktionieren. Ich habe da ein gutes Powershell Script gefunden es doch lauffähig zu machen, habe es etwas meine Bedürfnisse Angepasst. $RemoteAppNameTemp = Read-Host -Prompt 'Bitte RemoteAppName eingeben: ' $ExtensionTemp = Read-Host -Prompt 'Bitte Erweiterung in Form von .ext eingeben ' $RDPFileTemp = Read-Host -Prompt 'Bitte den Pfad zur RDP Datei eingeben ' $IconFileTemp = Read-Host -Prompt 'Bitte den Pfad zum ICON für die RDP Datei eingeben ' function Add-RemoteAppDefaultProgram{ Param( [Parameter(Mandatory=$true)] [string]$RemoteAppName, [Array]$Extension, [string]$RDPFile, [string]$IconFile ) #end param $username = $Env:Username $AppName = $RemoteAppName foreach($ext in $Extension){ New-Item "HKCU:\Software\Classes\$($Ext)" -force -ea SilentlyContinue New-Item "HKCU:\Software\Classes\$($Ext)\OpenWithProgIds" -force -ea SilentlyContinue New-ItemProperty -LiteralPath "HKCU:\Software\Classes\$($Ext)\OpenWithProgIds" -Name "TSWorkspace.$($AppName)" -Value "" -PropertyType String -Force -ea SilentlyContinue; } #Adding Workspace to "OpenWith" registry. New-Item "HKCU:\Software\Classes\TSWorkspace.$($AppName)" -force -ea SilentlyContinue New-Item "HKCU:\Software\Classes\TSWorkspace.$($AppName)\Application" -force -ea SilentlyContinue New-Item "HKCU:\Software\Classes\TSWorkspace.$($AppName)\CurVer" -force -ea SilentlyContinue New-Item "HKCU:\Software\Classes\TSWorkspace.$($AppName)\DefaultIcon" -force -ea SilentlyContinue new-Item "HKCU:\Software\Classes\TSWorkspace.$($AppName)\shell" -force -ea SilentlyContinue New-Item "HKCU:\Software\Classes\TSWorkspace.$($AppName)\shell\open" -force -ea SilentlyContinue New-Item "HKCU:\Software\Classes\TSWorkspace.$($AppName)\shell\open\command" -force -ea SilentlyContinue New-ItemProperty -LiteralPath "HKCU:\Software\Classes\TSWorkspace.$($AppName)" -Name "(default)" -Value "$($AppName) $($Ext)" -PropertyType String -Force -ea SilentlyContinue; New-ItemProperty -LiteralPath "HKCU:\Software\Classes\TSWorkspace.$($AppName)" -Name "RemoteApp" -Value 1 -PropertyType DWord -Force -ea SilentlyContinue; New-ItemProperty -LiteralPath "HKCU:\Software\Classes\TSWorkspace.$($AppName)\Application" -Name "ApplicationName" -Value "$($AppName)" -PropertyType String -Force -ea SilentlyContinue; New-ItemProperty -LiteralPath "HKCU:\Software\Classes\TSWorkspace.$($AppName)\Application" -Name "ApplicationDescription" -Value "$($AppName)" -PropertyType String -Force -ea SilentlyContinue; echo New-ItemProperty -LiteralPath "HKCU:\Software\Classes\TSWorkspace.$($AppName)\Application" -Name "ApplicationIcon" -Value "`"$($IconFile)`",0" -PropertyType String -Force -ea SilentlyContinue; New-ItemProperty -LiteralPath "HKCU:\Software\Classes\TSWorkspace.$($AppName)\Application" -Name "ApplicationCompany" -Value "Applicaties" -PropertyType String -Force -ea SilentlyContinue; New-ItemProperty -LiteralPath "HKCU:\Software\Classes\TSWorkspace.$($AppName)\CurVer" -Name "(default)" -Value "TSWorkspace.$($AppName)" -PropertyType String -Force -ea SilentlyContinue; New-ItemProperty -LiteralPath "HKCU:\Software\Classes\TSWorkspace.$($AppName)\DefaultIcon" -Name "(default)" -Value "`"$($IconFile)`",0" -PropertyType String -Force -ea SilentlyContinue; New-ItemProperty -LiteralPath "HKCU:\Software\Classes\TSWorkspace.$($AppName)\shell\open\command" -Name "(default)" -Value "`"%systemroot%\system32\mstsc.exe`" /REMOTEFILE:`"%1`" `"$($RDPFile)`"" -PropertyType ExpandString -Force -ea SilentlyContinue; } Add-RemoteAppDefaultProgram -RemoteAppName $RemoteAppNameTemp -Extension $ExtensionTemp -RDPFile $RDPFileTemp -Iconfile $IconFileTemp Viel spass damit :)
×
×
  • Neu erstellen...