James' website

This is a test website to try out GitHub and Git Bash

View My GitHub Profile

Using start

04 Jun 2022 - jhunter

Sources

get-help start

https://www.windowscentral.com/how-manage-app-execution-aliases-windows-10

Command

start

Alias

start-process

Definition

Start a process.

Examples

Start a program

Start notepad simply.

start notepad

image

Start a program using its path

Most programs on a computer do not have their own shortcut, and you need to use the path in order to start the application.

start 'D:\Data\Program Files\PFTP\pftp.exe'

image

Start a file with a particular program

Here I can open up a file with a program that I specify in the command.

start .\test.txt notepad.exe

Open a URL with the default application

This example starts a webpage using the computer’s default browser.

start www.google.com

Manage the application shortcuts

In Windows 11 settings

Open the Windows settings (shortcut Win + I) then in Application, then Other Settings, then Manage application execution aliases.

Here you can enable or disable aliases for applications. I suppose you would only do this is two apps have the same alias.

image

In the registry

In powershell use these commands to create an alias for the Personal FTP server. First create an item in the regedit.

New-Item -Path 'HKCU:\Software\Microsoft\Windows\CurrentVersion\App Paths' -Name "pftp.exe"

image

Then define the path.

New-ItemProperty -Path 'HKCU:\Software\Microsoft\Windows\CurrentVersion\App Paths\pftp.exe\' -Name "Path" -Value "D:\Data\Program Files\PFTP"

With the path is created the ‘(default)’ property, which needs to contain the path to the executable file.

Set-ItemProperty -Path 'HKCU:\Software\Microsoft\Windows\CurrentVersion\App Paths\pftp.exe\' -Name "(default)" -Value "D:\Data\Program Files\PFTP\pftp.exe"

image

Now I can use pftp or pftp.exe from the ‘Run’ dialogue.

In order to utilise this app path in the command line, it required a restart of my computer.

image

Note that pftp.exe alone fails: I need to write start pftp.exe.

Also, this change to the registry does not put my shortcut in the list of aliases in the settings.