Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


ZIP'ing in WinXP natively

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,27111
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> ZIP'ing in WinXP natively
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 ZIP'ing in WinXP natively - 10/20/2005 1:01:09 AM   
  Cybex


Posts: 412
Score: 0
Joined: 9/14/2005
From: Florida
Status: offline
I have been searching, trying to find a way to script the creation of a zip file only using windows native “Compressed (zipped) Folder” functionality.  I have discovered that the “Compressed (zipped) Folder” icon in the “Send To” directory is a “.ZFSendToTarget” extension.  From what I can tell this file relies on 3 DLL’s to work.  The one for creating zip’s is zipfldr.dll.  There are references inside the DLL to DynaZip.  I am guessing that MS acquired this and incorporated it into the OS.  I have to use native apps only, WinZip would be great but can not add any additional software.  As a temp workaround I was able to script the dynamic creation of an executable that contains the data I am trying to compress and archive.  I was able to use “IExpress.exe” and script the passing of the variables into my dynamically created “.SED” file, which is required to run the IExpress process from commandline.  IExpress then creates an auto extracting executable with the file inside.  I used IExpress to create a “.CAB” file but there is a limitation on the length of the cab files name. (legacy 8.3 filenames).  The filename that must be on the compressed/zipped file needs to be the name of the file that was placed inside.  I have scripted this part already. 

I have already tried simply compressing the file using Windows file compression but as it stands so far just compressing only takes a 1.73Mb file down to 1.06Mb.  The zipping process takes it down to 695Kb.  The IExpress, even with the added extraction messages and GUI functionality is the best coming in at 583Kb.  I will stay with IExpress if I have to but I would like to have the ability to create “.ZIP” files, it is more commonly identified and accepted as an archiving medium than “.EXE” is.  Some people may give me static about creating new executables on secure systems.  Working in these types of environments is always challenging.


Thanks,
Cybex
 
 
Post #: 1
 
 RE: ZIP'ing in WinXP natively - 10/20/2005 4:08:15 AM   
  sethsdad


Posts: 115
Score: 0
Joined: 4/4/2005
From: USA
Status: offline
Can you use ASP? That seems to be the only route available in VBS.

(in reply to Cybex)
 
 
Post #: 2
 
 RE: ZIP'ing in WinXP natively - 10/20/2005 5:07:22 AM   
  Cybex


Posts: 412
Score: 0
Joined: 9/14/2005
From: Florida
Status: offline
I know nothing about ASP. 
Is support native?  Is it anything similar to VBS?
I am not against learning a new trick here and there.


Cybex

(in reply to sethsdad)
 
 
Post #: 3
 
 RE: ZIP'ing in WinXP natively - 10/20/2005 5:23:17 AM   
  Snipah


Posts: 1343
Score: 6
Joined: 11/1/2004
From: Netherlands
Status: offline
Hiya Cybex...

So far i have found a VB.NET version of some script.... (DynaZIP)

quote:

ORIGINAL Innermedia.com about DynaZip Max Secure
Microsoft chooses DynaZip as the compression engine inside   Windows XP



‘ A simple VB.Net subroutine using DynaZip Max Secure  to
‘ zip up some files and record a result code
Private Sub Zip_It(strZipFile As String, strItemsToZip As String)
  ' Create an instance of the DynaZip Max Secure  .NET assembly
  Dim dzn As CDZipSNET
dzn = New CDZipSNET()
  ' Set the name of the zip file you want to create
  dzn.ZIPFile = strZipFile
  ' Set the File Items to be zipped
  dzn.ItemList = strItemsToZip
  ' Tell DynaZip Max Secure  to start zipping up the files
  dzn.ActionDZ = CDZipSNET.DZACTION.ZIP_ADD
  ' Check for errors and display or record result
If (dzn.ErrorCode <> CDZipSNET.ZIPRESPONSE.ZE_OK) Then
   ‘ Display Error condition if desired
  End If
  strResult = dzn.ErrorCode.ToString()
End Sub


_____________________________

For more information, please see the "Read me First" topic.

http://www.visualbasicscript.com

(in reply to sethsdad)
 
 
Post #: 4
 
 RE: ZIP'ing in WinXP natively - 10/20/2005 6:04:52 AM   
  Cybex


Posts: 412
Score: 0
Joined: 9/14/2005
From: Florida
Status: offline
Good job.

Do you think this means that it can only be accomplished via VB and not through VBS?

Cybex

(in reply to Snipah)
 
 
Post #: 5
 
 RE: ZIP'ing in WinXP natively - 10/20/2005 6:10:22 AM   
  Snipah


Posts: 1343
Score: 6
Joined: 11/1/2004
From: Netherlands
Status: offline
I read in their manuals that if you'd install their product (so not the baked MS version) then there are some examples of zipping thru ASP (ASP uses VBScript for 99%)  in their \Scripts\ASP\VBScript folder....

You could go to the site, download it (DynaZIP MAX Secure) and see how it looks...(link is in my previous post)

Snipah

_____________________________

For more information, please see the "Read me First" topic.

http://www.visualbasicscript.com

(in reply to Cybex)
 
 
Post #: 6
 
 RE: ZIP'ing in WinXP natively - 10/20/2005 6:26:47 AM   
  sethsdad


Posts: 115
Score: 0
Joined: 4/4/2005
From: USA
Status: offline
another thought - if you're going to stay in "native" XP, you could possibly launch a new instance of explorer.exe and feed it the information to create the "compressed folder".

(in reply to Snipah)
 
 
Post #: 7
 
 RE: ZIP'ing in WinXP natively - 10/20/2005 6:29:20 AM   
  Snipah


Posts: 1343
Score: 6
Joined: 11/1/2004
From: Netherlands
Status: offline
compressed ZIP you mean?

You cannot use FSO to create a zip (and feed explorer)...could you elaborate some more on that?

_____________________________

For more information, please see the "Read me First" topic.

http://www.visualbasicscript.com

(in reply to sethsdad)
 
 
Post #: 8
 
 RE: ZIP'ing in WinXP natively - 10/20/2005 11:27:31 PM   
  sethsdad


Posts: 115
Score: 0
Joined: 4/4/2005
From: USA
Status: offline
The thought was this:   since Cybex can't use "non-native" software (IE WINZIP, downloaded DOS Shell PKZIP), I was thinking that he could open a new instance of explorer and feed it a script like perhaps explore.exe < makeazip.txt.  Probably just a pipe dream.

(in reply to Snipah)
 
 
Post #: 9
 
 RE: ZIP'ing in WinXP natively - 10/21/2005 12:41:53 AM   
  TNO


Posts: 1074
Score: 10
Joined: 12/18/2004
From: thenewobjective.com
Status: offline
Windows XP uses zipfldr.dll to do the dirty work, but I have no idea how to use it. The closest thing I can find: http://www.eggheadcafe.com/ng/microsoft.public.vb.ole.automation/post11015994.asp
http://64.233.167.104/search?q=cache:Xtcm4EGiz64J:www.zahui.com/html/7/14379.htm+zipfldr.dll+Clsid+object&hl=en

<Edit>
the following from the command line opens the Zip file in explorer:

rundll32.exe zipfldr.dll,RouteTheCall C:\Documents and Settings\Owner\Desktop\wscriptobject.zip
</Edit>

< Message edited by TNO -- 10/21/2005 1:35:54 AM >


_____________________________

To iterate is human, to recurse divine. -- L. Peter Deutsch

(in reply to sethsdad)
 
 
Post #: 10
 
 RE: ZIP'ing in WinXP natively - 10/21/2005 2:30:41 AM   
  TNO


Posts: 1074
Score: 10
Joined: 12/18/2004
From: thenewobjective.com
Status: offline
I think I found it:


      

< Message edited by TNO -- 10/21/2005 2:31:51 AM >


_____________________________

To iterate is human, to recurse divine. -- L. Peter Deutsch

(in reply to TNO)
 
 
Post #: 11
 
 RE: ZIP'ing in WinXP natively - 10/21/2005 3:43:46 AM   
  Cybex


Posts: 412
Score: 0
Joined: 9/14/2005
From: Florida
Status: offline
I tried to follow the code but I got lost...

Line 3, "If WScript.Arguments.Count = 0 Then WScript.Quit"  does not seem to "End If" and if you try to it errors out.  This is new to me.  Are there situations where VBS will accept this?

I see it WScript but I guess I am missing where the path varaible is being declared.  Is the path variable considered to be the location of the script?

Sorry I am new as well and I am having a hard time following this.  When I run it I do not get an error, I get nothing.

Cybex

(in reply to TNO)
 
 
Post #: 12
 
 RE: ZIP'ing in WinXP natively - 10/21/2005 3:47:04 AM   
  sethsdad


Posts: 115
Score: 0
Joined: 4/4/2005
From: USA
Status: offline
End If is implied here, not required for a single line if

Could have been coded (for a purist) as

If WScript.Arguments.Count = 0 Then
     WScript.Quit
end if

(in reply to Cybex)
 
 
Post #: 13
 
 RE: ZIP'ing in WinXP natively - 10/21/2005 3:49:31 AM   
  ebgreen


Posts: 4613
Score: 31
Joined: 7/12/2005
Status: offline
One line if then statements are acceptable. Try this to see:

strTest = "Foo"
if strTest <> "Foo" Then WScript.Echo "You should not see this message"
if strTest = "Foo" Then WScript.Echo "You should see this one fine"


As for path being declared, I don't see a path variable in that code?

(in reply to Cybex)
 
 
Post #: 14
 
 RE: ZIP'ing in WinXP natively - 10/21/2005 4:20:19 AM   
  Snipah


Posts: 1343
Score: 6
Joined: 11/1/2004
From: Netherlands
Status: offline
The one-line If is the exception where no End If is required...

the path is defined by the arguments....

_____________________________

For more information, please see the "Read me First" topic.

http://www.visualbasicscript.com

(in reply to Cybex)
 
 
Post #: 15
 
 RE: ZIP'ing in WinXP natively - 10/21/2005 12:38:34 PM   
  TNO


Posts: 1074
Score: 10
Joined: 12/18/2004
From: thenewobjective.com
Status: offline
 JavaScript befuddles my brain sometimes. The original script was in a japanese website. I tried to translate and debug as well as I could.

_____________________________

To iterate is human, to recurse divine. -- L. Peter Deutsch

(in reply to Snipah)
 
 
Post #: 16
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> ZIP'ing in WinXP natively Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts