globas.blogg.se

Windows terminal shortcut
Windows terminal shortcut







windows terminal shortcut

The code snippet will currently use the path of the WinX for current user (using the LOCALAPPDATA environment variable) Default User modification You can change the first line in the PowerShell code snippet to modify the path to where the WinX menu files are located. This means that I can happily share my Windows Terminal shortcut file and it will work just fine on any Windows OS that has the Windows Terminal app installed. This ensures that Windows will launch the app regardless of where you have it installed. Instead, since Windows Terminal is a Windows Store app, the shortcut refers to the ApplicationId of the Windows Terminal application. If you inspect the Windows Terminal Shortcut supplied here, you will notice that it does not refer to the Windows Terminal app by a fixed path. > hashlnk.exe "Windows Terminal Shortcut.lnk" There is a tool hashlnk that can be used to hash shortcut links. Shortcut files in the WinX folder have to be hashed correctly to be accepted by Windows. Save()Īfter restarting the explorer.exe shell, or by logging out and back in again, the Windows Terminal shortcuts should appear in the Windows+X context menu. Description = $normalDisplay # Set Display in Win+X menu using T as the mnemonic character $normalShortcut. # Change the Normal Shortcut display name (Description) $normalShortcut = $shell. ::WriteAllBytes( $adminFilePath, $adminBytes) $adminBytes = $adminBytes -bor 0x20 #set byte 21 (0x15) bit 6 (0x20) ON # Setting the Run as administrator flag does not have an API, flip the bit manually # ref.: $adminBytes = ::ReadAllBytes( $adminFilePath)

windows terminal shortcut

Description = $adminDisplay # Set Display in Win+X menu using A as the mnemonic character $adminShortcut. # Change the Admin Shortcut display name (Description) and mark as Run as Administrator $adminShortcut = $shell. Remove-Item -Verbose -Force $shortcutFile # Get the Windows Shell COM service instance: $shell = New-Object -COM WScript.Shell

windows terminal shortcut

$folderPath = " $ ENV:LOCALAPPDATA\Microsoft\Windows\WinX\Group3 " $adminFilePath = Join-Path $folderPath "00 - Windows Terminal.lnk " $normalFilePath = Join-Path $folderPath "00a - Windows Terminal.lnk " $adminDisplay = "Windows Terminal (&Admin) " $normalDisplay = "Windows &Terminal " $shortcutFile = Join-Path $ ENV:TEMP "Windows Terminal Shortcut.lnk " Invoke-WebRequest -OutFile $shortcutFile -Uri " " Copy-Item $shortcutFile $adminFilePath -Force -VerboseĬopy-Item $shortcutFile $normalFilePath -Force -Verbose









Windows terminal shortcut