문제

I have a CentOS box able to access a Windows box's Cygwin via ssh. I want to run ssh me@windowsbox 'vol F:' in a script to capture the name and serial number of a plugged-in USB drive, but I get:

bash: vol: command not found

I would just run the path to vol.exe, but there's no such thing: VOL is built into cmd.exe.

How can I use VOL in Cygwin?

도움이 되었습니까?

해결책

Launch cmd.exe from within Cygwin with the /C switch and the command in quotes:

cmd /C "vol F:"

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top