This post originated from an RSS feed registered with Ruby Buzz
by Red Handed.
Original Post: Ruby for Windows in Under 1K
Feed Title: RedHanded
Feed URL: http://redhanded.hobix.com/index.xml
Feed Description: sneaking Ruby through the system
If you enjoyed Rubyless Ruby, here’s a remix for Windows. I’m using the Windows Scripting Host for this one, which means an appearance from good ol’ XmlHttpRequest. It’s the first new wave of 2006: Ajax for Batch Files, peoepl!
Here’s the code, I’ll show ya how to run it after the jump.
You can download the script try.js by doing a right-click Save as... in IE. To run the thing from the prompt:
cscript /Nologo try.js
While the Windows Scripting Host has probably been the number one source of viruses for the platform (ILOVEYOU comes to mind), it’s actually a very natural way to shell script. Many years ago there was a brilliant desktop shell called Graphite which had WSH hooks. It’s too bad that lots of stuff is buried in obscure objects.
For the above script, I found the ss64 reference to be the most practical reference. And JS/XHR docs are wide and far, of course.