
Besoin de transférer des fichiers sur votre site web mais pas de client FTP sous la main...qu'à cela ne tienne le navigateur web fera très bien l'affaire.
Testé sous Windows XP SP2.
J'attends vos tests sur Vista et Seven 

Code:
[lang=vb]Titre = "FTP EXPLORER © Hackoo © 2012"Set objIE = CreateObject( "InternetExplorer.Application" )
objIE.Navigate "about:blank"
objIE.Document.Title = Titre
objIE.ToolBar = False
objIE.Resizable = False
objIE.StatusBar = False
objIE.Width = 320
objIE.Height = 300
With objIE.Document.ParentWindow.Screen
objIE.Left = (.AvailWidth - objIE.Width ) \ 2
objIE.Top = (.Availheight - objIE.Height) \ 2
End With
Do While objIE.Busy
WScript.Sleep 200
Loop
objIE.Document.Body.InnerHTML = "<div align=""center""><p><h3 style='color:Red'>Nom Utilisateur " _
& "<br><input type=""text"" style='color:Blue' size=""20"" " _
& "id=""Login"" value=""USER LOGIN""></h3></p>"_
& "</p><p><h3 style='color:Red'>Mot de passe<br><input type=""password"" style='color:Blue' value=""password"" size=""20"" " _
& "id=""Password""></h3></p><p><input type=" _
& """hidden"" id=""OK"" name=""OK"" value=""0"">" _
&"<h3 style='color:Red'>Serveur FTP " _
& "<br><input type=""text"" style='color:Blue' size=""20"" " _
& "id=""FTPSERVER"" value=""ftp.membres.lycos.fr""></h3></p>"_
& "<input type=""submit"" value="" EXPLORER FTP "" " _
& "onclick=""VBScript:OK.Value=1""></p></div>"
objIE.Document.Body.Style.overflow = "auto"
objIE.Document.body.style.backgroundcolor="lightblue"
objIE.Visible = True
objIE.Document.All.Password.Focus
On Error Resume Next
Do While objIE.Document.All.OK.Value = 0
WScript.Sleep 200
If Err Then
IELogin = Array( "", "" )
objIE.Quit
Set objIE = Nothing
wscript.quit
End if
Loop
On Error Goto 0
Set ws = CreateObject("wscript.Shell")
Login = objIE.Document.All.Login.Value
Password = objIE.Document.All.Password.Value
FTPSERVER = objIE.Document.All.FTPSERVER.Value
'Fermer("Explorer.exe")
'Ouvrir("Explorer.exe")
URL = "ftp://"&Login&":"&Password&"@"&FTPSERVER&""
Connect2FTP = ws.run("Explorer "& URL ,1,False)
objIE.Quit
ws.Popup "Connexion à "&qq(FTPSERVER)&" est en cours......",3,"Connexion à "&qq(FTPSERVER)&"est en cours......",64
Set objIE = Nothing
Set ws = Nothing
Sub Fermer(Process)
Set Ws = CreateObject("Wscript.Shell")
Command = "cmd /c Taskkill /F /IM "&Process&""
Execution = Ws.Run(Command,0,True)
End Sub
Sub Ouvrir(Process)
Set Ws = CreateObject("Wscript.Shell")
Command = "cmd /c Start "&Process&""
Execution = Ws.Run(Command,0,True)
End Sub
Function qq(strIn)
qq = Chr(34) & strIn & Chr(34)
End Function
Dernière édition par Hackoo le Mar 14 Aoû 2012 - 18:16; édité 1 fois
______________________________________________________
Mes Contributions en Téléchargement