R
Rich Pasco
What are the best ways for a shell script (CMD or BAT file) to query:
(a) the current default drive?
(b) the current working directory on a specified drive?
The best ways I can think of:
To query the default drive, issue the "CD" command with no
parameters, and capture the first two characters of its output
(drive letter and colon), e.g.
To query the current working directory on a specified drive,
issue the CD command with that drive as its parameter (e.g.
CD D and then capture its output.
Can anyone suggest a cleaner way?
- Rich
(a) the current default drive?
(b) the current working directory on a specified drive?
The best ways I can think of:
To query the default drive, issue the "CD" command with no
parameters, and capture the first two characters of its output
(drive letter and colon), e.g.
To query the current working directory on a specified drive,
issue the CD command with that drive as its parameter (e.g.
CD D and then capture its output.
Can anyone suggest a cleaner way?
- Rich