Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In Windows 7, I could launch a program like Notepad and pass it a command-line argument (the path and filename of a document to open) by typing:

Windows Keynotepad c:\users\jon\myfile.txtEnter

In Windows 8 and Windows 10, although either of the following work fine to launch Notepad:

Windows KeynotepadEnter (via the Start page / Metro UI)

Windows Key+SnotepadEnter (via the Search charm)

Adding a command-line argument as in the original example above does not work. It causes Windows to not find the program. (Windows 10 launches a web search for whatever I typed instead of running the program.)

So I have had to adjust my workflow in Windows 8/10 to (1) launch the application, and then (2) manually bring up a File Open dialog from within the application to load by document. It's annoying having to do in two separate steps what I used to be able to accomplish in Windows 7 with just one.

Running the application via Windows Key+R (the old Windows XP style Run dialog) with command line arguments works, but only for applications that are on the Path -- not for applications that Windows can find via its Search feature.

Is there any way to get my original example above working under Windows 8/10?

share|improve this question

Probably, they fixed this in Windows 10 since the question was asked, but this works for me out of the box:

WIN, notepad test

The second entry in the result list allows to run the notepad application with the test command line argument. (The "Best match" first entry starts a search). So you then need to press Down and then Enter to run the command.

As soon as I type either a file extension or a path separator, the "run command" entry becomes the first "Best match" entry. So, after typing

WIN, notepad.exe test

WIN, notepad test.txt

WIN, notepad c:\

- I then only need to press Enter to run the notepad application with the command line arguments.

To allow a custom application to be run the same way, it can be added to the HKLM\Software\Microsoft\Windows\CurrentVersion\App Paths registry key like the following (replace the values below with the needed values):

Add key someapp.exe with the following string values:

(Default) : C:\Path to app\someapp.exe

Path : C:\Path to app\

This is the same way which allows to run some custom application from the Windows Run (WIN+R) dialog, even if the application is not in the PATH environmental variable.

share|improve this answer

If you know the name of the exe of the program (eg iexplore.exe) rather than the program name (Internet Explorer),you can launch the program with partners by searching for the name of the exe and remembering to put the extension .exe with it. (eg iexplore.exe) Then you can add your partners like you used too.

If you don't know what the exe of a program is you can find it by right click on the program in the search and select "Open File Location" from there keep right clicking the file the previous link and selecting "Open File Location" till it brings you too an exe. So long that exe is in the search database you can use the name of it in search as mentioned earlier.

Example(s):

WIN + S notepad.exe c:\users\etc

Rather Than: Notepad c:\users\etc

&

WIN + S iexplore.exe google.com

Rather Than: Internet Explorer google.com

share|improve this answer
1  
This works, but is not what is currently asked. Similar unasked alternative: right click on start, select comand prompt. and use that rather than the start menu. – Hennes Feb 17 at 12:03

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.