Jump to content
Sign in to follow this  
Tlem

Vista and 7z.exe

Recommended Posts

Tlem

Hello everybody.

This script work fine on Windows XP but don't extract files on Windows Vista !

And When he ask me for the file, the filter doesn't work !

#include <array.au3>
#include <file.au3>
#NoTrayIcon
#RequireAdmin

Dim $ResZIP, $DirExt1, $DirZip, $ZipExt1, $InfoFile
Dim $szDrive, $szDir, $szFName, $szExt

FileInstall(".\7z.exe", @ScriptDir)

; Zip File to chose.
$ZipExt1 = FileOpenDialog("Chemin du fichier ZIP","","Archive (*.zip)", 1+2)

; ZIP use.
If $ZipExt1 <> "" Then
    ; Creation of the Ext1 temporary directory
    $InfoFile = _PathSplit($ZipExt1, $szDrive, $szDir, $szFName, $szExt)

    $DirZip = $InfoFile[1]&$InfoFile[2]
    $Res = DirCreate($DirZip & 'Ext1')
        If $Res = 0 Then 
            Msgbox(32,"Erreur","Impossible de créer le répertoire temporaire " & @CRLF & _
            "Echec de la Conversion !")
            Exit
        EndIf
    
    $DirExt1 = $DirZip & 'Ext1'

    If FileExists($DirExt1&"\*.txt") Then FileDelete($DirExt1&"\*.txt")

    ; Extract files.
    ShellExecuteWait(@ScriptDir&'\7z.exe', ' e "'&$ZipExt1&'" -o"'&$DirExt1&'" *.txt -y', "", "", @SW_HIDE)

EndIf

Can someone help me to fix my problem

Thanks by advance.


Best Regards.Thierry

Share this post


Link to post
Share on other sites
Rick

what version of 7z are you using as I believe its been updated for vista

also, check to see the output of the command line youre sending it

Edited by Rick

Who needs puzzles when we have AutoIt!!

Share this post


Link to post
Share on other sites
Danny35d

I'm surprise that even work with Windows XP. Out of the help file:

FileInstall ( "source", "dest" [, flag] )

dest = The destination path of the file with trailing backslash if only the directory is used. This can be a variable.

The fileinstall line should be:

FileInstall(".\7z.exe", @ScriptDir & "\")


AutoIt Scripts:NetPrinter - Network Printer UtilityRobocopyGUI - GUI interface for M$ robocopy command line

Share this post


Link to post
Share on other sites
Rick

oops, didnt spot that :">


Who needs puzzles when we have AutoIt!!

Share this post


Link to post
Share on other sites
Tlem

I'm surprise that even work with Windows XP. The fileinstall line should be:

FileInstall(".\7z.exe", @ScriptDir & "\")

Sorry, it's just a mistake on my post (I just forgot the backslash).

The problem is not on the FileInstall part, but on the ShellExecuteWait part.


Best Regards.Thierry

Share this post


Link to post
Share on other sites
Tlem

I found my problem, and Shame on me, to not see it before.

So finally I saw that I was using the 7z.exe how is the command line of 7zip, but I forgot to install 7zip on the Vista PC, so I haven't the 7z.dll installed :)

I'll try it with the 7za.exe how is the standalone program of 7zip, and it work great.

Excuse me for this :) :)


Best Regards.Thierry

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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.