CD |SET /p DRIVE=
ECHO You are on Drive %DRIVE%
When run from any named drive, using the command line, it outputs:
You are on Drive x
where x is the drive letter.
Unfortunately it won't run from a batch script. And even more unfortunately, batch scripts run from UNC paths hurl themselves back to C:\Windows before they start.
Does anyone know of a way of detecting whether a batch script was started from a UNC path, and what that path was?
Another useful item would be whether the current drive is read-only...?