0

I would like to know what this command does in a batch script:

subst Q: /D  1>nul  2>nul
Mat
  • 202,337
  • 40
  • 393
  • 406
iDev
  • 2,163
  • 10
  • 39
  • 64

2 Answers2

1

That looks like a DOS command (not bash).

subst substitutes a folder for a drive letter or substitutes one drive letter for another

The /D deletes (actually unmounts) a virtual (previously substituted) drive. So your command basically removes the virtual drive Q:

The 1>nul and 2>nul just get rid of the output (ie sends the standard output and standard error output to the nul device).

Keith Flower
  • 4,032
  • 25
  • 16
  • And there's no bash equivalent to this command, as UNIX doesn't have drive letters. –  Jul 25 '12 at 23:49
  • Yep. Gave me some traumatic flashbacks there for a moment, too. My edit to his/her tags and title is queued for review. – Keith Flower Jul 25 '12 at 23:52
0

The subst command you are talking about is a DOS command, not bash.

What it does, is that it unmounts the virtual drive Q:, and the 1 > nul 2 > nul basically means that all output from the command is discarded.

Wouter
  • 833
  • 6
  • 13