Direct Download to users Desktop

Hello, I'm French

 

I want to create link to download image to direct %users% desktop.

I want to use this script or other :

 

Code: vbscript
  1. Sub Object_OnLButtonDown(x,y)
  2. System.DownloadFile "http://siteweb.com/downloads/icons/icons.gif", "%DESKTOP%\icons.gif", True
  3. End Sub

 

But not work.

 

Can you help me please ?

 

Verry Thanks for all

19,555 views 7 replies
Reply #1 Top

Weird.  Failing here too using absolute paths.

Reply #2 Top

Yeah, it looks like it's the absolute path; those don't really work in my experience with DX. Have to go the old Shell Object route. Try this one:

Const DESKTOP = &H10&
Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.Namespace(DESKTOP)
Set objFolderItem = objFolder.Self
Dim desktoppath : desktoppath = objFolderItem.Path

Sub Object_OnLButtonDown(x,y)
 System.DownloadFile "http://siteweb.com/downloads/icons/icons.gif", desktoppath &"\icons.gif", True
End Sub

+2 Loading…
Reply #3 Top

Thanks Eve!   :inlove:

Reply #5 Top

:thumbsup:

Reply #6 Top

Quoting sViz, reply 2
Yeah, it looks like it's the absolute path; those don't really work in my experience with DX. Have to go the old Shell Object route. Try this one:

Const DESKTOP = &H10&
Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.Namespace(DESKTOP)
Set objFolderItem = objFolder.Self
Dim desktoppath : desktoppath = objFolderItem.Path

Sub Object_OnLButtonDown(x,y)
 System.DownloadFile "http://siteweb.com/downloads/icons/icons.gif", desktoppath &"\icons.gif", True
End Sub

sViz=SuperCoder:thumbsup:

Reply #7 Top

Quoting msprod, reply 4
It's Work !!!

 

Veryyyyyy Tahnks !!!

No problem.:) And thanks to Jim (RedneckDude) for bringing it to my attention.

+1 Loading…