Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Execute shortcuts like programs

Tags:

powershell

Example: You have a shortcut s to SomeProgram in the current directory.

In cmd.exe, you can type s and it will launch the program.

In PowerShell, typing s gives:

The term 's' is not recognized as a cmdlet, function, operable program, or script file. Verify the term and try again.

If you type s.lnk or SomeProgram, it runs the program just fine.

How can I configure PowerShell to execute shortcuts just like programs?

like image 256
Emperor XLII Avatar asked Aug 22 '08 14:08

Emperor XLII


People also ask

Is there a better app than shortcuts?

There are more than 100 alternatives to Siri Shortcuts for a variety of platforms, including Android, Online / Web-based, Linux, iPhone and iPad. The best alternative is IFTTT, which is free. Other great apps like Siri Shortcuts are n8n.io, Zapier, Huginn and UI. Vision RPA.

How do I run a program shortcut?

First things first, the most efficient way to call up the Run command dialog box is to use this keyboard shortcut combination: Windows key + R. It is common for modern PC keyboards to have a key in the bottom row next to the Left-Alt key marked with the Windows logo–that is the Windows key.


1 Answers

You can also invoke a shortcut by using the "invoke-item" cmdlet. So for example if you wanted to launch "internet explorer.lnk" you can type the following command:

invoke-item 'Internet Explorer.lnk'

Or you could also use the alias

ii 'internet explorer.lnk'

Another cool thing is that you could do "invoke-item t.txt" and it would automatically open whatever the default handler for *.txt files were, such as notepad.

Note If you want to execute an application, app.exe, in the current directory you have to actually specify the path, relative or absolute, to execute. ".\app.exe" is what you would need to type to execute the application.

like image 137
Mark Schill Avatar answered Sep 23 '22 22:09

Mark Schill