plusieurs commandes avec CreateObject("WScript.Shell" ) et methode run - ASP - Programmation
Marsh Posté le 05-12-2003 à 10:30:49
Pour ceux que ça interresse voici la solution : 
 
--------------------------------------------------------------- 
PAKCommand = "c:\zip\zip.exe  c:\site\tmp\test.zip dossier_a_telecharger\*.* "  
dir = "c:\site\upload\client\nom_client\dossier" 
RunExe(PAKCommand)  
 
'Runs command and wait for exit  
Function RunExe(dir,Command) 
  On Error Resume Next 
  Dim ShellObject 
  Set ShellObject = CreateObject("WScript.Shell" ) 
  Response.write ("cmd /c cd c:\ & cd "&dir&" & "&Command) 
  RunExe = ShellObject.Run ("cmd /c cd c:\ & cd "&dir&" & "&Command, 1, True) 
  ShellObject = Empty 
  If Err <> 0 Then 
    RunExe = Err 
  End If 
  On Error GoTo 0 
End Function 
------------------------------------------------------- 
Mettre des & entre les différentes commandes !
Marsh Posté le 13-11-2003 à 15:38:33
Bonjour
Pour zipper un dossier j'utilise des ligne de commandes :
****************************************************************
PAKCommand = "c:\zip\zip.exe c:\site\tmp\test.zip c:\site\upload\client\nom_client\dossier\dossier_a_telecharger\*.* "
RunExe(PAKCommand)
'Runs command and wait for exit
Function RunExe(Command)
On Error Resume Next
Dim ShellObject
Set ShellObject = CreateObject("WScript.Shell" )
response.write Command &"<br>"
RunExe = ShellObject.Run(Command, 1, True) & vbCrLf
ShellObject = Empty
If Err <> 0 Then
RunExe = Err
End If
On Error GoTo 0
End Function
****************************************************************
Ca marche bien le dossier est zippé mais il contient toute l'arborescence (site\upload\client\nom_client\dossier\dossier_a_telecharger) alors que j'aimerais avoir que le dossier_a_telecharger
Pour cela il faudrait qu'avant d'exécuter la commande de zip je me place dans le repertoire du client mais je n'arrive pas à executer 2 commandes de suite, c'est à dire un cd c:\site\uoload\ ... et celle de la variable PAKCommand
Quelqu'un peut-il m'aider ?
Merci
So07