From: Charles Roper Date: 2010-11-25T03:21:53+09:00 Subject: Re: system() or process.create? Del is part of cmd.exe, which is possibly why Process.create is not working. Have a look here: http://www.computerhope.com/cmd.htm http://www.computerhope.com/delhlp.htm You could try something like Process.create('cmd.exe /c del *.zip') Alternatively, why not use FileUtils.rm to delete files? Like this: FileUtils.rm Dir.glob('*.zip') Docs: http://ruby-doc.org/core/classes/FileUtils.html#M004332 Charles On 24 November 2010 09:52, Fengfeng Li wrote: > Arturo Garcia wrote in post #963497: >> On Wednesday 24 November 2010 08:03:59 Fengfeng Li wrote: >>> [... ... ...] >>> cmd = "del *.zip" >>> Process.create( >>> >>>   :app_name => cmd, >>>   :startup_info=>  {:sw_flags=>Process::SW_HIDE , :startf_flags => >>> >>> Process::STARTF_USESHOWWINDOW}                    ) >> Is "del" is an actual executable?  It used to be in old DOS but Mr. >> Windows >> has a history of change.... > > I use fileUtils.chdir(dir) to change to a dir in which .zip files exist, > then I can use system("del *.zip") to del them, but Process.create() > will report an error. Maybe because fileUtils.chdir(dir) doesn't work > for Process.create()? > > -- > Posted via http://www.ruby-forum.com/. > >