Solved

Launching WinZip from the Shell

Posted on 2003-11-25
2
433 Views
Last Modified: 2008-03-06
Hi experts,
           i've been trying to start winzip from the shell, but each time, I have the file not found error  ... !!??

But if I paste the content of strCommande in the "run" box of Windows, it goes ok.  What am I doing wrong here ?

Here is my code:

*********************
these are the parameter sent to the function :

GestionWinZip.GestionWinZip m_strEnvironnement, "c:\test.zip", Fichier.Path

m_strEnvironnement = "CAPDEV"
Fichier.Path = "D:\Donnees_devl\CAP2002\Capfax\ReceptionRsp\Capdev\1004363.rsp"

Public Sub GestionWinZip(ByVal strEnvironnement As String, ByVal strNomArchive As String, ByVal strFichiers As String)
   
    Dim strWinZipPath As String
    Dim strCommande As String
   
    Dim fso As New Scripting.FileSystemObject
   
    On Error GoTo TrappeErreur
   
    'Si le nom du fichier à compresser possède des espaces, l'entouré de ""
    If InStr(1, strFichiers, " ", vbTextCompare) <> 0 Then
        strFichiers = Chr(34) & strFichiers & Chr(34)
    End If
           
    If (Not fso.FileExists(strNomArchive)) Then
        fso.CreateTextFile (strNomArchive)
    End If
   
    strCommande = "WINZIP32.EXE -min -a " & strNomArchive & " " & "'" + strFichiers + "'"
   
    Shell(strCommande, vbHide)
   
    'Shell("winzip32 -min -a c:\test.zip c:\op.txt", vbHide)
   
    Set fso = Nothing
   
TrappeErreur:
   
    Set fso = Nothing
   
    Err.Raise vbObjectError + 100, "Projet1.GestionWinzip", "Problème avec la compression WinZip."

End Sub

***************************************

The same thing happens when I do a test with :

 Shell("winzip32 -min -a c:\test.zip c:\op.txt", vbHide)

THanks a lot, and a lot of beer to ya all !

Regards!
0
Comment
Question by:David MacDonald
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 3

Accepted Solution

by:
Informative earned 75 total points
ID: 9820347
This works fine for me.

Dim x As Variant
x = Shell("winzip32.exe -min -a c:\test.zip c:\op.txt", vbHide)

All I had to do to make it work properly was either give the full qualified path of winzip or else copy everything from the winzip folder into say Windows\system32 where it will be certainly found in the path.  I'm using Winzip 8.1

Cheers and have a Slurpee on me.
0
 
LVL 1

Author Comment

by:David MacDonald
ID: 9820369
hahah ... funny me ... the idea of the coming beer must've clouded my mind with hapinness ... itwork well with the full qualified path ...

Thanks a lot Informative ...
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question