2

With the start command in a Windows command line it is possible top apply the default context-menu "open" operation on a file, like:

start file.pdf

But the Windows context menu may define other operations than "open", for example an "Edit" or "Print" operation like shown below.

enter image description here

How to apply another context-menu operation to a file on the comment line, for example "Edit" or "Print"?

1
  • It should be possible. I don't have time to dig out the details right now but the operations and defaults are defined in the registry. Mar 25, 2015 at 17:21

1 Answer 1

0

I don't believe you can choose whichever action you want from the command-line, you can change the default action though.

Changing default filetype action

I'll use PDF as an example.

At a Command Prompt type:

assoc .pdf

The command should return something similar to this:

.pdf=AcroExch.Document.11

Using the value above we can change the default action in the registry.

Open the registry and navigate to:

HKLM\SOFTWARE\Classes\AcroExch.Document.11\shell

Obviously switching out AcroExch.Document.11 with the result from the previous command.

Change the (Default) value here to the desired default action. If you expand the shell key you should see the options available for the filetype.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .