views:

53

answers:

3

I keep running into issues with a .bat script I want to write to automate some tasks related to the setup of my PHP application. I can't for instance do simple wget to download files and so on.

I hear that by installing Cygwin, the user should be able to have access to all linux related commands, so my script will run without problems.

Another way is to get the user to download each GnuWin32 version of the commands I'm using in my script, like wget, gzip, diff but this sounds like a lot more trouble than installing a single Cygwin program.

Can someone recommend the easiest approach here.. Is Cygwin the standard or are there easier alternatives.

+3  A: 

I haven't heard of alternatives to Cygwin, and from my personal experience, it seems like it would perfectly suit your needs. You'll just need to launch your script from Cygwin's shell instead of Windows' prompt, but that hardly is a problem.

Anthony Labarre
+2  A: 

If you are having problems with batch files then rather than install Cygwin, I'd look at PowerShell and WScript.

Lazarus
Interesting alternative. So how would getting a file from the web for example look like with WScript and would I need to ask my windows users to install anything before they can run my script
Berming
Have a look here: http://www.ericphelps.com/scripting/samples/BinaryDownload/index.htm
Lazarus
+2  A: 

Hard to answer, because the way you phrase your question seems to imply that the person answering must have absolute knowledge about what is easiest and that there's not any alternatives.

Among the people I know Cygwin is the standard for getting a posix like environment under windows.

I'd go for cygwin.

thomasmalt