Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Running Windows native commands (e.g. VOL) from Cygwin

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?

like image 792
Kev Avatar asked Jul 24 '13 21:07

Kev


People also ask

How do I open a Cygwin file?

If you right-click on a . txt file and select "open with" you should be able to click "Browse" and go to C:\cygwin\bin\vim-nox.exe . Then you can click "Always use the selected program to open this kind of file". However, I prefer to just have a "native" Windows Vim install and use that.


1 Answers

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

cmd /C "vol F:"

like image 158
Kev Avatar answered Oct 03 '22 19:10

Kev