1

Whenever I try to open a document or program with more than one word in the title with the correct syntax (using the "start" command and putting the document or program name in quotations), it opens up a new window of the Windows Command Prompt instead of the document or program. Taking out the spaces of the document or program will open the document or program, but I don't want to have to change the title of all my documents or programs just to be able to open them through Windows Command Prompt or Git Bash.

1

How do you open a document or program that has more than one word in the title?

When using start, the first argument that is quoted is assumed to the the title of the cmd window that is opened.

Syntax

START "title" [/D path] [options] "command" [parameters]

...

Always include a TITLE this can be a simple string like "My Script" or just a pair of empty quotes "" According to the Microsoft documentation, the title is optional, but depending on the other options chosen you can have problems if it is omitted.

Source Start - Start a program - Windows CMD - SS64.com

What you need to do is use an empty string "" for the window title.

Example:

start `""` notepad "my document.txt

Or, if notepad is the defualt program for opening .txt files:

start `""` "my document.txt

Source Start - Start a program - Windows CMD - SS64.com


Further Reading

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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