Dim objNetwork Dim objFSO Dim sSourcePath 'dossier source où se situe le fichier à sauvagarder Dim sSaveName 'fichier à sauvegarder Dim Hostname 'ressource cible Dim strPathDestination 'dossier destination où copier le fichier Dim objShell Hostname=InputBox("Nom de Machine / IP ") Set objShell = CreateObject("Wscript.Shell") sSourcePath = "C:\temp\drivers" sSaveName= "driver.msi" strPathDestination ="\" & Hostname & "\C$\temp" Set objFSO =CreateObject("Scripting.FileSystemObject") objFSO.CopyFile sSourcePath & sSaveName, strPathDestination objShell.Run "cmd /k psexec -c -f -high \"& hostname &" c:\temp\drivers\deploy.cmd " Set ObjFSO= Nothing
C:\emeadts\driver.msi /quiet
objNetwork.MapNetworkDrive strDriveLetter, strRemotePath, strUsername, strPassword
Dim objNetwork Dim objFSO Dim strDriveLetter Dim strRemotePath 'remote path / ressource partagée distante Dim strUsername ' remote user / utilisateur distant Dim strPassword 'mot de passe utilisateur distant Dim sSourcePath 'dossier source où se situe le fichier à sauvagarder Dim sSaveName 'fichier à sauvegarder Dim strPathDestination 'dossier destination où copier le fichier DIM objShell hostname=InputBox("Nom de Machine / IP ") Set objShell = CreateObject("Wscript.Shell") strUsername="DOMAIN\USER" strPassword ="MoDePass" sSaveName= "Intel_HD" strDriveLetter = "L:" strRemotePath = "\\SERVER\applis" strPathDestination ="\"&"& hostname & "&"\c$\drivers" Set objNetwork = CreateObject("WScript.Network") Set objFSO =CreateObject("Scripting.FileSystemObject") objNetwork.MapNetworkDrive strDriveLetter, strRemotePath, strUsername, strPassword WScript.Sleep 1000 objFSO.CopyFolder sSourcePath & sSaveName, strDriveLetter & strPathDestination objNetwork.RemoveNetworkDrive(strDriveLetter) Set objNetwork = Nothing Set ObjFSO= Nothing
strPathDestination ="\"&"& hostname & "&"\c$\drivers"