From: Bob Calco Date: 2001-12-01T04:58:45+09:00 Subject: [ruby-talk:27118] Re: FW: Kernel::system() not working No, that's not working either. I tried: cmd "C:\PRogram Files\Some Company\Some Product\Prog.exe" and it doesn't work, even at the command line, even though "C:\PRogram Files\Some Company\Some Product\Prog.exe" typed by itself at the command line fires it right up. BTW, cmd.exe by itself gives me: Microsoft Windows 2000 [Version 5.00.2195] (C) Copyright 1985-2000 Microsoft Corportation at the command line. system("cmd "+cmd) doesn't work either. For crying out loud this was working fine until today! FindTest.executable?(cmd) still says TRUE, so does test(?e,cmd). :| Bob -----Original Message----- From: Phil Tomson [mailto:ptkwt@shell1.aracnet.com] Sent: Friday, November 30, 2001 2:17 PM To: ruby-talk ML; undisclosed-recipients: Subject: [ruby-talk:27111] Re: FW: Kernel::system() not working In article , Bob Calco wrote: >Anybody have any idea? This is a showstopper for me, simple as it seems. I >cannot seem to start up a windows exe using system anymore, it worked find >yesterday, today it does not. > >I have tried different windows programs, and they all fail with error code >32512. I cannot seem to figure out what's changed that makes the system() >calls not work now, on either my laptop or desktop. > >Any clues about what I might be doing wrong? > >Sincerely > >Bob Calco > >-----Original Message----- >From: Bob Calco [mailto:rcalco@cortechs.com] >Sent: Friday, November 30, 2001 12:07 PM >To: ruby-talk ML >Subject: [ruby-talk:27089] Kernel::system() not working > > >Yesderday, this worked: > >cmd = "C:\\Program Files\\Some Company\\Some Program\\Prog.exe" >system(cmd) > >Today, it does not. $? shows error code 32512. > >Mind you, at the command line, this works: > >"C:\Program Files\Some Company\Some Program\Prog.exe" > >So does a shortcut on my desktop with the same. > >And test(?e,cmd) returns > >true > >Other things like > >system("cl") > >and > >system("echo *") > >work... > >So -- any ideas what happened??? Like I said, yesderday, that cmd worked. > I'm not sure why the difference between yesterday and today (but you are working with Windows, remember ;-). But I believe your problem is that you need to run your executable with command.com (on win95|98|ME) or cmd.exe (on winNT|2K|XP). So you need to do: cmd = "C:\\Program Files\\Some Company\\Some Program\\Prog.exe" system("cmd.exe "+cmd) #NT|2K|XP and system("command.com "+cmd) #95|98|ME apparently things like 'echo' and 'cl' are built-in to the command interpreter, so you don't need to add the extra bits to get them to work. Or you could use Win32::TimedSystemCommand or Win32::Process from my Win32 module. Phil