0

I would like to silently save out a report from msinfo32.exe using ruby. How can I do so? I tried the following

system "msinfo32.exe /\report c:/\/\temp/\/\fromruby.txt"
exec 'msinfo32.exe /\report c:/\/\temp/\/\fromruby.txt'
IO.popen("msinfo32.exe /\report c:/\/\temp/\/\fromruby.txt")

and all of these open the application instead of silently creating the report.

Thanks in advance.

ybi
  • 171
  • 1
  • 3
  • 9

1 Answers1

0
system "msinfo32.exe /\report c:/\/\temp/\/\fromruby.txt"
                      ^^           ^^

\r is a carriage return, \t is a tab character, and \f is a formfeed. none of those have to be escaped at all in the first place.

so instead of executing a single command:

msinfo32.exe /report c:\temp\fromruby.txt

you're executing all of these separate commands:

msinfo32.exe /
eport c://        temp//
romruby.txt
Marc B
  • 356,200
  • 43
  • 426
  • 500
  • Thank you Mark. After removing the escapes the system command works. However exec and IO.open fails with "Access Denied" message...but as system works I am good.....Thank you very much. – ybi Sep 14 '15 at 22:31