Re: unzipping file and overwritting old file...
- From: dot <""tsr\"@tpg(dot)com(dot)au">
- Date: Tue, 28 Nov 2006 11:01:51 +1100
mjs wrote:
thank you....In WinMe and later Explorer handles compressed files via zipfldr.dll. Unfortunately I haven't been able to find anyone who has successfully scripted it so I had to use an external control. I also have a SAP server where it wasn't possible to install a control so I have used
and i was looking to only use the OS's features...(i.e., no outside sources)
???
thank you.
"dot" <"tsr(at)tpg(dot)com(dot)au" wrote:
mjs wrote:unzipping file and overwritting old file...I have successfully used Molezip. http://devtools.teggo.com/molezip/
i would like to have a script that unzips a zipped file and when a previous file exists, to overwrite this file (without human response)...?
???
thank you.
Function UnzipFile (ZipSourceFile , ZipContentFile, DestFile)
'This function uses molezip to unzip a single file. Molezip is very
'basic and cannot overwrite existing files. It 'might'
'work with wildcards but hasn't been tested.
Set fso = CreateObject("Scripting.FileSystemObject")
Set Mzip = CreateObject("MoleZip.ZipFile")
MZip.Open ZipSourcefile, True
'Delete the old file first or Molezip will silently fail
If fso.FileExists(DestFile) Then
Set aFile = fso.GetFile(DestFile)
aFile.Delete
End If
'Extract the file.
MZip.Extract ZipContentFile, DestFile
Mzip.Close
UnzipFile = "File Extracted"
End Function
TSR
the freeware Infozip and its companion Unzip from a shell:
Set WshShell = CreateObject("WScript.Shell")
ZipFile
Sub ZipFile
' MsgBox "Starting Zip"
ret=WshShell.Run("zip.exe -r -j c:\test1.zip C:\dest\destfile.txt",0,True)
' MsgBox "done"
End Sub
I tried for a while to find a purely internal solution and had to go with these in the end.
Cheers,
TSR
.
- References:
- Prev by Date: Disable Inactive users
- Next by Date: Re: !!! vbScript Output to an HTML File !!!!!
- Previous by thread: Re: unzipping file and overwritting old file...
- Next by thread: Re: List all installed application
- Index(es):
Relevant Pages
|