Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)
Paste
Pasted by foobar ( 14 years ago )
Function Zip(sFile,sArchiveName)
Set oFSO = WScript.CreateObject("Scripting.FileSystemObject")
Set oShell = WScript.CreateObject("Wscript.Shell")
aScriptFilename = Split(Wscript.ScriptFullName, "\")
sScriptFilename = aScriptFileName(Ubound(aScriptFilename))
sWorkingDirectory = Replace(Wscript.ScriptFullName, sScriptFilename, "")
If oFSO.FileExists(sWorkingDirectory & " " & "WZZIP.EXE") Then
sWinZipLocation = ""
ElseIf oFSO.FileExists("C:\programme\WinZip\WZZIP.EXE") Then
sWinZipLocation = "C:\programme\WinZip\"
Else
Zip = "Error: Couldn't find WZZIP.EXE"
Exit Function
End If
'Vorher war nur herausfinden wo Winzip ist usw.
'hier wird dann gestartet: "<pfad zu winzzip>/wzzip.exe -ex -r -p -whs -ybc -r "archivname" <filename>
oShell.Run """" & sWinZipLocation & "wzzip.exe"" -ex -r -p -whs -ybc -r """ & _
sArchiveName & """ """ & sFile & """", 0, True
'Existiert danach die Ausgabedatei?
If oFSO.FileExists(sArchiveName) Then
Zip = 1
Else
Zip = "Error: Archive Creation Failed." 'Wenn nicht: Fehler
End If
End Function
Revise this Paste