1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67
| Dim strFileURL,strHDLocation,Title
Title = "Télécharger un Jeu Flash avec exécution par Vbscript + AutoSupprim © Hackoo © 2011"
Set objFSO = Createobject("Scripting.FileSystemObject")
PathScript = objFSO.GetParentFolderName(wscript.ScriptFullName) 'Chemin ou se localise le Vbscript
MsgBox PathScript,64,"Chemin du Script"
' ---------------------------------Les paramètres à modifier pour télécharger le jeu---------------------------------
strFileURL = "http://www.jeuxclic.com/jeux/game-1270029047.swf"
strHDLocation = PathScript & "\Coast Bike.swf"
' ---------------------------------Les paramètres à modifier pour télécharger le jeu---------------------------------
' Récupérer le fichier
Set Ws = CreateObject("WScript.Shell")
Set objXMLHTTP = CreateObject("MSXML2.XMLHTTP")
objXMLHTTP.open "GET", strFileURL, false
objXMLHTTP.send()
If objXMLHTTP.Status = 200 Then
Set objADOStream = CreateObject("ADODB.Stream")
objADOStream.Open
objADOStream.Type = 1 'adTypeBinary
objADOStream.Write objXMLHTTP.ResponseBody
objADOStream.Position = 0 'Set the stream position to the start
If objFSO.Fileexists(strHDLocation) Then objFSO.DeleteFile strHDLocation
objADOStream.SaveToFile strHDLocation
objADOStream.Close
Set objADOStream = Nothing
End If
Set objXMLHTTP = Nothing
Function Explorer()
'Autoriser le contenu actif à s'exécuter dans les fichiers de la zone Ordinateur local
LockDown="HKLM\Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_LOCALMACHINE_LOCKDOWN\"
Keysec1=LockDown & "iexplore.exe"
itemtype = "REG_DWORD"
WS.RegWrite Keysec1,0,itemtype
Ws.Run "%comspec% /c Start iexplore " & strHDLocation, 0, 1
wscript.sleep 5000
WS.SendKeys "{F11}" 'pour mettre internet explorer en plein écran
Set WS = Nothing
end Function
Function qq(strIn)
qq = Chr(34) & strIn & Chr(34)
End Function
Question = MsgBox ("The File "& qq(strHDLocation) &" is Downloaded Successfully ! " & Vbcr & "Do you want open its location now ?",VBYesNO+VbQuestion,Title)
If Question = VbYes then
Call Explorer()
End if
wscript.sleep 10000
Question2 = MsgBox ("The File "& qq(strHDLocation) &" must be deleted ! " & Vbcr & "Do you want to delete it now ?",VBYesNO+VbQuestion,Title)
If Question2 = VbYes then
If objFSO.Fileexists(strHDLocation) Then objFSO.DeleteFile strHDLocation
End if
wscript.sleep 10000
Question3 = MsgBox ("The File "& qq(WScript.ScriptFullName) &" must be deleted ! " & Vbcr & "Do you want to delete it now ?",VBYesNO+VbQuestion,Title)
If Question3 = VbYes then
Call AutoSupprim
End if
Sub AutoSupprim
Set objFSO = CreateObject( "Scripting.FileSystemObject" )
objFSO.DeleteFile WScript.ScriptFullName
Set objFSO = Nothing
end sub |
Partager