Shell function in A97

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Les Desser

    Shell function in A97

    Can anyone explain why the string

    "C:\Program Files\WinZip\wz unzip" -t ZipFileName

    does nothing[1] when run via the Shell function, but

    cmd /c "C:\Program Files\WinZip\wz unzip" -t ZipFileName

    works.

    I cannot find any way to keep the command window open to see what is
    happening.

    [1] The command window just flashes on the task bar

    Thanks.
    --
    Les Desser
    (The Reply-to address IS valid)
  • Tom van Stiphout

    #2
    Re: Shell function in A97

    On Wed, 15 Sep 2004 16:03:50 +0100, Les Desser
    <NewsDump1@dess ergroup.com> wrote:

    Enter this in a command window:
    cmd /?
    You'll learn about the /K command line argument.

    -Tom.


    [color=blue]
    >Can anyone explain why the string
    >
    >"C:\Program Files\WinZip\wz unzip" -t ZipFileName
    >
    >does nothing[1] when run via the Shell function, but
    >
    >cmd /c "C:\Program Files\WinZip\wz unzip" -t ZipFileName
    >
    >works.
    >
    >I cannot find any way to keep the command window open to see what is
    >happening.
    >
    >[1] The command window just flashes on the task bar
    >
    >Thanks.[/color]

    Comment

    • Les Desser

      #3
      Re: Shell function in A97

      In article <fj5jk05sghc2pc 053qb6ud4aci836 too3k@4ax.com>, Tom van
      Stiphout <no.spam.tom774 4@cox.net> Thu, 16 Sep 2004 06:46:16 writes
      [color=blue]
      >On Wed, 15 Sep 2004 16:03:50 +0100, Les Desser
      ><NewsDump1@des sergroup.com> wrote:
      >[color=green]
      >>Can anyone explain why the string
      >>
      >>"C:\Program Files\WinZip\wz unzip" -t ZipFileName
      >>
      >>does nothing[1] when run via the Shell function, but
      >>
      >>cmd /c "C:\Program Files\WinZip\wz unzip" -t ZipFileName
      >>
      >>works.
      >>
      >>I cannot find any way to keep the command window open to see what is
      >>happening.
      >>
      >>[1] The command window just flashes on the task bar[/color][/color]
      [color=blue]
      >Enter this in a command window:
      >cmd /?
      >You'll learn about the /K command line argument.
      >[/color]
      Thanks for that, but I was referring to try and keep open the command
      window when using the first sample above - without the cmd prefix. That
      is the version that is not working and closes without a chance to see
      what is wrong. If I add in cmd at the start of the line it works! So
      then I don't need to have the window open but it is - there is a law
      about it somewhere :(
      --
      Les Desser
      (The Reply-to address IS valid)

      Comment

      • CSL

        #4
        Re: Shell function in A97

        Hi Les,

        this is the part of code I use for the SHELL.

        On Error Resume Next

        var_process_num ber = Shell("wzzip.ex e -exm .....,
        vbMinimizedNoFo cus)

        If Err Then
        If Err.Number = 53 Then
        MsgBox "Stopped
        Else
        MsgBox "Export Stopped." & "Problem : " & Err.Description ,
        vbExclamation, "Export"
        End If
        Err.clear
        End If

        On Error GoTo error_handler:

        If var_process_num ber = 0 Then
        MsgBox "Export Stopped
        Else 'wait until compressing is over
        var_process_han dle = OpenProcess(&H1 00000, True,
        var_process_num ber)
        WaitForSingleOb ject var_process_han dle, -1
        CloseHandle var_process_han dle

        ------------------------------------------------------

        Declare Function OpenProcess Lib "kernel32" (ByVal dwDesiredAccess As
        Long, ByVal bInheritHandle As Long, ByVal dwProcessId As Long) As Long
        Declare Function WaitForSingleOb ject Lib "kernel32" (ByVal hHandle As
        Long, ByVal dwMilliseconds As Long) As Long
        Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Long) As
        Long




        *** Sent via Developersdex http://www.developersdex.com ***
        Don't just participate in USENET...get rewarded for it!

        Comment

        • Les Desser

          #5
          Re: Shell function in A97

          In article <414ea7f9$0$261 43$c397aba@news .newsgroups.ws> , CSL
          <csl_dev@hotmai l.com> Mon, 20 Sep 2004 09:50:49 writes
          [color=blue]
          >this is the part of code I use for the SHELL.[/color]

          Thanks for the code and I will study it a bit later.

          Since the original post, via Google I got hold of some ready-made
          routine from Terry Kreft (ShellWait) which solved the problem as well as
          the more serious one, in my case, of the Access Shell not waiting till
          the command finishes.

          Your code seems to do similar and is shorter. I will need to study both
          when time permits.

          Thanks again.
          --
          Les Desser
          (The Reply-to address IS valid)

          Comment

          Working...