lundi 20 septembre 2010

Paramètres de ligne de commande pour WinZip

Source : http://www.memecode.com/docs/winzip.html


What command line parameters does WinZip support?





Below is some information about the undocumented
command line options for using the WinZip program module, winzip32.exe.




WinZip supports command line options to add and extract from files.
Be sure to read the Notes section below for additional
important information.

Adding Files





The command format is:


winzip32 [-min] action [options] filename[.zip] files


where:




-min specifies that WinZip should run minimized. If -min
is specified, it must be the first command line parameter.



action


-a for add, -f for freshen, -u

for update, and -m for move. You must specify one (and only one)
of these actions. The actions correspond to the actions described in the section titled
"Add dialog box options" in the online manual.



options


-r corresponds to the Include subfolders checkbox in the Add dialog
and causes WinZip to add files from subfolders. Folder information is stored for files added
from subfolders. If you add -p, WinZip will store folder information for all
files added, not just for files from subfolders; the folder information will begin with the folder
specified on the command line.



-ex, -en,
-ef, -es, and -e0 determine the compression method: eXtra,
Normal, Fast, Super fast, and no compression. The default is "Normal".
-hs includes hidden and system files.
Use -sPassword to specify a case-sensitive password.
The password can be enclosed in quotes, for example, -s"Secret Password".



filename.zip


Specifies the name of the Zip file involved. Be sure to use the full
filename (including the folder).



files


Is a list of one or more files, or the @ character followed by the
filename containing a list of files to add, one filename per line.
Wildcards (e.g. *.bak) are allowed.


Extracting Files





The command format is:

    winzip32 -e [options] filename[.zip] folder

where -e is required.



options


-o and -j stand for "Overwrite existing files without prompting" and
"Junk pathnames", respectively. Unless -j is specified, folder
information is used.
Use -sPassword to specify a case-sensitive password.
The password can be enclosed in quotes, for example, -s"Secret Password".



filename.zip


Specifies the name of the Zip file involved. Be sure to specify the full
filename (including the folder).



folder


Is the name of the folder to which the files are extracted. If the
folder does not exist it is created.



Notes



  • VERY IMPORTANT: always specify complete filenames, including the
    full folder name and drive letter, for all file IDs.



  • To run WinZip in a minimized inactive icon use the "-min" option.
    When specified this option must be the first option.



  • Only operations involving the built-in zip and unzip are supported.



  • Enclose long filenames in quotes.



  • When using a list ("@") file, no leading or trailing spaces
    should appear in file IDs in the list.




  • The action and each option must be separated by at least one space.



  • WinZip can be used to compress files with cc:Mail . Change the
    compress= line in the [cc:Mail] section of the appropriate WMAIL.INI
    files to specify the full path for WinZip followed by "-a %1 @%2".
    For example, if WinZip is installed in your c:\winzip folder,
    specify

        compress=c:\winzip\winzip.exe -a %1 @%2


mercredi 8 septembre 2010

VBS pour ZIP dossier puis Archivage FTP

Dim azipper, cheminwinzip, cibleduzip


Set objShell = CreateObject("Shell.Application")
Set WshShell = WScript.CreateObject("WScript.Shell")


cibleduzip = "D:\www\_aArchiver\Applis\EMS.zip"
azipper = "D:\www\EMS"
WshShell.Run "WINZIP32.exe" & " -a -r " & """" & cibleduzip & """" & " " & """" & azipper & """"

cibleduzip = "D:\www\_aArchiver\Applis\FichesLiaisonEDP.zip"
azipper = "D:\www\FichesLiaisonEDP"
WshShell.Run "WINZIP32.exe" & " -a -r " & """" & cibleduzip & """" & " " & """" & azipper & """"

cibleduzip = "D:\www\_aArchiver\Applis\NCP.zip"
azipper = "D:\www\NCP"
WshShell.Run "WINZIP32.exe" & " -a -r " & """" & cibleduzip & """" & " " & """" & azipper & """"

cibleduzip = "D:\www\_aArchiver\Applis\SaisieStats.zip"
azipper = "D:\www\SaisieStats"
WshShell.Run "WINZIP32.exe" & " -a -r " & """" & cibleduzip & """" & " " & """" & azipper & """"

cibleduzip = "D:\www\_aArchiver\Applis\StatsEDP.zip"
azipper = "D:\www\StatsEDP"
WshShell.Run "WINZIP32.exe" & " -a -r " & """" & cibleduzip & """" & " " & """" & azipper & """"


'temporisation 30 sec pour finir le zip
WScript.Sleep 30000

'Backup FTP
Set FSys = CreateObject("Scripting.FileSystemObject")
Set MonFichierBat = FSys.CreateTextFile("D:\www\_ScriptsArchivage\backupApplis.bat")

Dim ipFTP
ipFTP = "nn.nnn.nn.nnn"
'Nom du répertoire dont le contenu est à sauvegarder, SANS le \ à la fin
Dim oRep
oRep = "D:\www\_aArchiver\Applis\"


Dim horodate
horodate = Replace(Date(),"/","_") & "__" & Replace(Time(),":","_")

'dans le dossier : "Backup"
dossierArchivage = "Applis_" & horodate

With MonFichierBat

.writeLine "echo open """ & ipFTP & """ > c:\temp\monftp.ftp"
.writeLine "echo backup>> c:\temp\monftp.ftp"
.writeLine "echo backup>> c:\temp\monftp.ftp"
.writeLine "echo mkdir """ & dossierArchivage & """>> c:\temp\monftp.ftp"
.writeLine "echo cd """ & dossierArchivage & """>> c:\temp\monftp.ftp"


Dim oFSO
Set oFSO = CreateObject("Scripting.FileSystemObject")


Dim oSousRep
Dim oFichier


.writeLine "echo prompt>> c:\temp\monftp.ftp"



.writeLine "echo mput """ & oRep & "\*.*" & """>> c:\temp\monftp.ftp"




If oFSO.FolderExists(oRep) Then
For each oSousRep in oFSO.GetFolder(oRep).SubFolders

'je créé le sous dossier correspondant et je me place dedans (je suis dans le dossierArchivage)
.writeLine "echo mkdir """ & oSousRep.Name & """>> c:\temp\monftp.ftp"
.writeLine "echo cd """ & oSousRep.Name & """>> c:\temp\monftp.ftp"

'j'y copie tous les fichiers
.writeLine "echo mput """ & oRep & "\" & oSousRep.Name & "\*.*" & """>> c:\temp\monftp.ftp"


'je me repositionne dans le dossierArchivage
.writeLine "echo cd ..>> c:\temp\monftp.ftp"
Next

End If






.writeLine "echo prompt>> c:\temp\monftp.ftp"
.writeLine "echo bye>> c:\temp\monftp.ftp"

.writeLine "FTP -s:c:\temp\monftp.ftp"

.writeLine "del c:\temp\monftp.ftp"
.writeLine "echo O | del D:\www\_aArchiver\Applis\*.*"


.Close

End With

Dim shell, commande
Set shell = WScript.CreateObject("WScript.Shell")
commande="D:\www\_ScriptsArchivage\backupApplis.bat"
shell.Run commande, 0,true
WScript.quit