Windows – Run a Windows command from cygwin

bash-scriptingbatch filecygwin;scriptwindows

Can I run a Windows command, and pass arguments to it, over cygwin?

Specifically I would like to have a bash script that runs Robocopy, but the question is general.

Robocopy is more suitable for my needs than rsync, but batch scripting is capricious. PowerShell seems interesting but I'd rather not learn a new language if possible, besides bash is very convenient.

I couldn't find any mention about it.

Thanks

Best Answer

You can run Windows commands by nesting cmd.exe from your Cygwin shell. Launch cmd.exe with /C option and the command in quotes:

 cmd /C "do_stuff.exe"
Related Question