12

Here somthing I want to do.

start /wait ((c:\Program Files\NetDrive2\nd2cmd.exe) -c m -t ftp -blabla)

If I do

start /wait "c:\Program Files\NetDrive2\nd2cmd.exe -c m -t ftp -blabla"

Then there is an error because "Program Files" has a space.

If I do

start /wait "c:\Program Files\NetDrive2\nd2cmd.exe" -c m -t ftp -blabla

Then it interprets the argument for start so it also generates an error.

Is there anyway to overlap the equation like bracket in normal program language?

G. Cito
  • 6,210
  • 3
  • 29
  • 42
user2958279
  • 570
  • 1
  • 5
  • 11
  • Possible duplicate of [Using the "start" command with parameters passed to the started program](https://stackoverflow.com/questions/154075/using-the-start-command-with-parameters-passed-to-the-started-program) – pjh Oct 18 '18 at 09:41

1 Answers1

21

Reference Start - Start a program, command or batch script (opens in a new window.)

Syntax

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

Key:

title Text for the CMD window title bar (required.)

path Starting directory.

command The command, batch file or executable program to run.

parameters The parameters passed to the command.

...

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 you may will have problems if it is omitted.

The reason you have an error if title is omitted is because the first " character (if present) will be used to delimit the title, so start will interpret "Program Files" as a title.

If there are no " characters then title can be omitted.

Your command should look like:

start /wait "My title" "c:\Program Files\NetDrive2\nd2cmd.exe" -c m -t ftp -blabla
Community
  • 1
  • 1
DavidPostill
  • 7,734
  • 9
  • 41
  • 60