Run a Windows command from cygwin

2

1

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

pfff

Posted 2017-01-29T13:09:34.930

Reputation: 121

yes, you can run them. Put just attention to correct escape, if needed. – matzeri – 2017-01-29T13:13:05.933

Answers

3

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"

Fluffy

Posted 2017-01-29T13:09:34.930

Reputation: 166