Skip to main content
added 227 characters in body
Source Link
Ben N
  • 41.3k
  • 17
  • 147
  • 191

Barlop is correct. If you add /k cd "\path\to\folder" to the Target field (after cmd.exe), the resultant Command Prompt window will execute the cd command and then leave you with a prompt to do with as you please. If you need to change to a different drive, you'll need cd /d rather than just cd. If you need to change to a network drive, use pushd instead - it automatically mounts the target UNC path as a drive and changes to it.

The /k switch to cmd means "do this command and keep the prompt open." Everything after the /k is treated as a literal command, so you don't have to worry about escaping. You can use && to execute multiple commands: cd "\path\to\folder" && echo Hi! will produce a prompt in that directory with Hi! printed at the top.

The equivalent of /k that doesn't keep the prompt around is /c (for "execute this command").

Barlop is correct. If you add /k cd "\path\to\folder" to the Target field (after cmd.exe), the resultant Command Prompt window will execute the cd command and then leave you with a prompt to do with as you please.

The /k switch to cmd means "do this command and keep the prompt open." Everything after the /k is treated as a literal command, so you don't have to worry about escaping. You can use && to execute multiple commands: cd "\path\to\folder" && echo Hi! will produce a prompt in that directory with Hi! printed at the top.

The equivalent of /k that doesn't keep the prompt around is /c (for "execute this command").

Barlop is correct. If you add /k cd "\path\to\folder" to the Target field (after cmd.exe), the resultant Command Prompt window will execute the cd command and then leave you with a prompt to do with as you please. If you need to change to a different drive, you'll need cd /d rather than just cd. If you need to change to a network drive, use pushd instead - it automatically mounts the target UNC path as a drive and changes to it.

The /k switch to cmd means "do this command and keep the prompt open." Everything after the /k is treated as a literal command, so you don't have to worry about escaping. You can use && to execute multiple commands: cd "\path\to\folder" && echo Hi! will produce a prompt in that directory with Hi! printed at the top.

The equivalent of /k that doesn't keep the prompt around is /c (for "execute this command").

Source Link
Ben N
  • 41.3k
  • 17
  • 147
  • 191

Barlop is correct. If you add /k cd "\path\to\folder" to the Target field (after cmd.exe), the resultant Command Prompt window will execute the cd command and then leave you with a prompt to do with as you please.

The /k switch to cmd means "do this command and keep the prompt open." Everything after the /k is treated as a literal command, so you don't have to worry about escaping. You can use && to execute multiple commands: cd "\path\to\folder" && echo Hi! will produce a prompt in that directory with Hi! printed at the top.

The equivalent of /k that doesn't keep the prompt around is /c (for "execute this command").