Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to add a ClickOnce application that uses .appref-ms to the system path?

I downloaded a Windows application called MarkdownPad (great app!) and would like to add it to my system path so that I can open it from the command line, e.g.

> markdownpad.exe .\something.md

However, I can't find where this application is installed on disk. When I look up the application in the start menu, all I see is a .appref-ms file. Opening it up in notepad, all I see is a URL, http://markdownpad.com/download/MarkdownPad.application#MarkdownPad.application. I'm not sure exactly how this is used, but it's not really helping me figure out how to run this tool from the command line.

Is there something I can do so that I can execute this application from the command line?

like image 427
Ben McCormack Avatar asked Dec 13 '22 08:12

Ben McCormack


2 Answers

If you associate .md files with MarkdownPad so that you can double-click to open them you can use the start utility to open markdown files.

That's what I do in my git repositories.

start README.md

Admittedly this only works if you name your markdown files with the .md extension.

There's probably an easier way of associating but here's what I did (Windows 7) so that I didn't have to browse to the path of Mp.

  1. Start MarkdownPad
  2. Drag random .md-file to the MarkdownPad icon in the taskbar (in order to hint to the OS that Mp is an alternative).
  3. Right-click on the same MD file, Select Open With -> Choose default program...
  4. Select MarkdownPad

The start utility is a godsend if you're in git bash or cmd.exe. Start foo.sln launches visual studio, start foo.jpg launches your default image viewer etc.

like image 199
Markus Olsson Avatar answered May 09 '23 13:05

Markus Olsson


Beat me to it :) I didn't realize you were using Powershell, so I whipped up a command file to do it. Figured I might as well post it as another option. The simplest way to make it work would be to save it as markdownpad.cmd and throw it in your system folder.

@echo OFF
set app=C:\Users\[UserName]\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\MarkdownPad\MarkdownPad.appref-ms

if [%1]==[] (
  "%app%"
  goto exit
) 

if exist "%~dpnx1" (
  "%app%" "%~dpnx1"
  goto exit
)

echo Can't find file, '%1%'

:exit
like image 22
codeConcussion Avatar answered May 09 '23 15:05

codeConcussion