Hello Everyone,
Or for that matter, how can I run a given command as if I entered it
into the DOS window?
Example:
C:\Documents and Settings\tnt>ipconfig
Windows 2000 IP Configuration
Ethernet adapter Local Area Connection:
Connection-specific DNS Suffix . :
IP Address. . . . . . . . . . . . : 192.168.1.115
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 192.168.1.1
Thank you,
Todd
Hello Everyone,
Or for that matter, how can I run a given command as if I entered it
into the DOS window?
Just run it with "system":
system "ipconfig"
If you want the output as a string, use backquotes:
output = `ipconfig`
Thank you,
Todd
You're welcome,
Christian Neukirchen
<chneukirchen@gmail.com>
···
On Mon, 28 Jun 2004 19:28:03 +0900, Todd Gardner <piir@earthlink.net> wrote:
C:\Documents and Settings\gabriele>irb
irb(main):001:0> str= `ipconfig`
=> "\r\nConfigurazione IP di Windows\r\n\r\n\r\nScheda Ethernet
Connessione alla
rete locale (LAN) 3:\r\n\r\n Suffisso DNS specifico per
connessione: \r\
n Indirizzo IP. . . . . . . . . . . . . : 10.0.0.1\r\n
Subnet mask
. . . . . . . . . . . . . : 255.255.255.0\r\n Gateway
predefinito . . .
.. . . . . . : 10.0.0.2\r\n"
Or IO.popen. Or system()
···
il 28 Jun 2004 03:25:56 -0700, piir@earthlink.net (Todd Gardner) ha scritto::
Hello Everyone,
Or for that matter, how can I run a given command as if I entered it
into the DOS window?