shellexecute = Win32API.new('urlmon.dll', 'URLDownloadToFileA', '%w(l p p l l)', 'l') shellexecute.call(0, url, filename, 0, 0)