"Mike" <mike / lepton.fr> wrote in message
news:20010513000930.76b645b6.mike / lepton.fr...
> Hi,
>
Hi,

> I cannot start programs that contains spaces in their filename on Win32. I
cannot either if the path contains spaces.
> I tried to copy c:/command.com to c:/a a.com and these calls:
>
> C:\>ruby -e "system 'c:/a a.com'"
> C:\>ruby -e "system 'c:/a\\ a.com'"
> C:\>ruby -e "system '\"c:/a\\ a.com\"'"
> C:\>ruby -e "system '\"c:/a a.com\"'"
> C:\>ruby -e "system 'c:/command.com'"
>
> Microsoft(R) Windows 98
>    (C)Copyright Microsoft Corp 1981-1999.
>
> C:\>exit
> C:\>
>
> Is there a way to call an executable containing spaces?
> Most Win32 applications are in "C:/Program Files" by default :(
>

Try this


require 'Win32API'

def system(command)
  Win32API.new("crtdll", "system", ['P'], 'L').Call(command)
end

system("\"c:\\a a.com\"")


> Thanks,
> Mike.

Park Hee-Sob.







-- 
Posted from co-location.ibsoft.iAsiaWorks.ne.kr [211.36.253.12] (may be forged) 
via Mailgate.ORG Server - http://www.Mailgate.ORG