Question

This is just a simple question. There are the following two lines of codes:

taskkill /F /IM notepad.exe

and---

taskkill /IM notepad.exe /F

In my test, it doesn't matter.
But in other languages / program, WILL IT MATTER?

Was it helpful?

Solution

There is no universal standard for parsing command line arguments. Each command/program is free to establish its own rules for parsing arguments. Some programs or commands require switches to be in specific places. Some don't care.

The DIR internal command allows switches to be placed anywhere and yield the same result.

The FINDSTR external command requires all switches to be at the beginning.

The COPY command allows the /A and /B switches to be anywhere, but with different meanings. Placing /A or /B at the beginning establishes a default format; after a source file name specifies the format for the preceding file; after the target establishes the format for the target.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top