topten

Vbscript code wrapper

6 posts in this topic

I have a vbscript code which is extracting a file from zipped archive

ZipFile5="c:\file.zip"
ExtractTo5="c:\folder"

set objShell5 = CreateObject("Shell.Application")
set FilesInZip5=objShell5.NameSpace(ZipFile5).items
objShell5.NameSpace(ExtractTo5).CopyHere(FilesInZip5),&H4

Set objShell5 = Nothing

I have written an autoit wrapper for that

 

$ZipFile5="C:\file.zip"
$ExtractTo5="C:\folder"



$objShell5 = ObjCreate ("Shell.Application")
$FilesInZip5=$objShell5.NameSpace($ZipFile5).items
$objShell5.NameSpace($ExtractTo5).CopyHere($FilesInZip5),&H4

It works fine if I dont use ",&H4" (option to unzip without progress bar)

When I add ,&H4 - I get an error 

==> Illegal text at the end of statement (one statement per line).:
$objShell5.NameSpace($ExtractTo5).CopyHere($FilesInZip5),&H4
$objShell5.NameSpace($ExtractTo5).CopyHere($FilesInZip5)^ ERROR

How can I use (wrap into autoit)  ,&H4 option?

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

I autoit Long type is not with &h You must set 0x4

 

Saludos

Edited by Danyfirex

Share this post


Link to post
Share on other sites

Danyfirex , Do you mean something like this:  

$objShell5.NameSpace($ExtractTo5).CopyHere($FilesInZip5) & 0x4 ; This way didnt work

 

Share this post


Link to post
Share on other sites

I meant this:

$objShell5.NameSpace($ExtractTo5).CopyHere($FilesInZip5), 0x4 ; This way didnt work

Saludos

Share this post


Link to post
Share on other sites

This is the correct solution:

$objShell5.NameSpace($ExtractTo5).CopyHere($FilesInZip5, 0x4)

 

Share this post


Link to post
Share on other sites

Good. I just noticed the &h4 part.

 

Saludos

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now