简体   繁体   中英

create a report from msinfo32.exe via ruby

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM