[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Windows Shell Commands

Boris \"BXS\" Schulz

11/6/2003 5:58:00 AM

Hi,

how can i use windows shell commands with ruby ?
I would like to call existing command line programs with parameters
given by ruby.
I am a scripting newbie and tried to look in google but could not find
anything, most likely my search terms were wrong.

greetings, BXS

3 Answers

Robert Klemme

11/6/2003 9:01:00 AM

0


"Boris "BXS" Schulz" <bxs@hadiko.de> schrieb im Newsbeitrag
news:bocnm7$lpq$1@news.rz.uni-karlsruhe.de...
> Hi,
>
> how can i use windows shell commands with ruby ?
> I would like to call existing command line programs with parameters
> given by ruby.
> I am a scripting newbie and tried to look in google but could not find
> anything, most likely my search terms were wrong.
>
> greetings, BXS
>

system( 'cmd', '/c', 'dir' )
system( 'cmd', '/c', 'dir', 'c:\\temp' )

etc.

robert



Josef 'Jupp' Schugt

11/7/2003 7:41:00 PM

0

* Robert Klemme; Thu, 6 Nov 2003 10:01:00 +0100

> "Boris "BXS" Schulz"
>>
>> how can i use windows shell commands with ruby ?
>> I would like to call existing command line programs with parameters
>> given by ruby.
>
> system( 'cmd', '/c', 'dir' )
> system( 'cmd', '/c', 'dir', 'c:\\temp' )
>
> etc.

I don't have any idea how to use 'system' to control the Windows
shell(*). Did you leave that question unanswered or can one access
WSH using 'system'? How?

(*) Perhaps I am just misunderstanding the question. Perhaps Boris
does call the CLI (in German it is called 'Eingabeaufforderung')
that way. In MS terminology it is another name for Explorer.

Josef 'Jupp' Schugt

Robert Klemme

11/10/2003 8:46:00 AM

0


"Josef 'Jupp' Schugt" <jupp@gmx.de> schrieb im Newsbeitrag
news:bogsfu$1e6ovi$1@ID-53633.news.uni-berlin.de...
> * Robert Klemme; Thu, 6 Nov 2003 10:01:00 +0100
>
> > "Boris "BXS" Schulz"
> >>
> >> how can i use windows shell commands with ruby ?
> >> I would like to call existing command line programs with parameters
> >> given by ruby.
> >
> > system( 'cmd', '/c', 'dir' )
> > system( 'cmd', '/c', 'dir', 'c:\\temp' )
> >
> > etc.
>
> I don't have any idea how to use 'system' to control the Windows
> shell(*). Did you leave that question unanswered or can one access
> WSH using 'system'? How?
>
> (*) Perhaps I am just misunderstanding the question. Perhaps Boris
> does call the CLI (in German it is called 'Eingabeaufforderung')
> that way. In MS terminology it is another name for Explorer.

IMHO Boris wanted to know how to access cmd.exe and other command line
oriented programs. At least that's the question I answered. :-)

Addtional info: there is WIN32OLE which can be used to control
applications such as MS Word, Explorer etc. But I didn't use that and so
I can't comment on those.

Regards

robert