From: Ken Allen Date: 2006-11-19T02:52:00+09:00 Subject: Re: newbie: how to script windows commands with ruby? `ping xxx` will work in windows as well. Try String#scan, String#split for scraping, as well as the rest of String's methods - they're very useful. `ping www.google.com`.split("\r\n") will get you an array of the lines of output. I can't really say more without knowing more about what you want to scrape out. Ken Jason Mayer wrote: > Hi! > > I've been learning ruby for a little while, but I'm having trouble > figuring out how to do this (and I must be using the wrong keywords in > my google search). I do tech support, and I'm looking to automate > some basic troubleshooting over a web interface for my coworkers and > new hires. > > What I'd like to do is script the windows ping command and scrape the > results. Anyone know where I can find good references on this? > > So I guess my question could be clarified as How do I script windows > command line commands via ruby (I understand that in linux I could > just use `ping xxx`)? > > The second question would be 'How do I scrape the output of a windows > cmd.exe command and use it in the rest of my script?' > > Thanks in advance! > >