Connecting Tech Pros Worldwide Forums | Help | Site Map

Shell function in A97

Les Desser
Guest
 
Posts: n/a
#1: Nov 13 '05
Can anyone explain why the string

"C:\Program Files\WinZip\wzunzip" -t ZipFileName

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

cmd /c "C:\Program Files\WinZip\wzunzip" -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
Guest
 
Posts: n/a
#2: Nov 13 '05

re: Shell function in A97


On Wed, 15 Sep 2004 16:03:50 +0100, Les Desser
<NewsDump1@dessergroup.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\wzunzip" -t ZipFileName
>
>does nothing[1] when run via the Shell function, but
>
>cmd /c "C:\Program Files\WinZip\wzunzip" -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]

Les Desser
Guest
 
Posts: n/a
#3: Nov 13 '05

re: Shell function in A97


In article <fj5jk05sghc2pc053qb6ud4aci836too3k@4ax.com>, Tom van
Stiphout <no.spam.tom7744@cox.net> Thu, 16 Sep 2004 06:46:16 writes
[color=blue]
>On Wed, 15 Sep 2004 16:03:50 +0100, Les Desser
><NewsDump1@dessergroup.com> wrote:
>[color=green]
>>Can anyone explain why the string
>>
>>"C:\Program Files\WinZip\wzunzip" -t ZipFileName
>>
>>does nothing[1] when run via the Shell function, but
>>
>>cmd /c "C:\Program Files\WinZip\wzunzip" -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)
CSL
Guest
 
Posts: n/a
#4: Nov 13 '05

re: Shell function in A97


Hi Les,

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

On Error Resume Next

var_process_number = Shell("wzzip.exe -exm .....,
vbMinimizedNoFocus)

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_number = 0 Then
MsgBox "Export Stopped
Else 'wait until compressing is over
var_process_handle = OpenProcess(&H100000, True,
var_process_number)
WaitForSingleObject var_process_handle, -1
CloseHandle var_process_handle

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

Declare Function OpenProcess Lib "kernel32" (ByVal dwDesiredAccess As
Long, ByVal bInheritHandle As Long, ByVal dwProcessId As Long) As Long
Declare Function WaitForSingleObject 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!
Les Desser
Guest
 
Posts: n/a
#5: Nov 13 '05

re: Shell function in A97


In article <414ea7f9$0$26143$c397aba@news.newsgroups.ws>, CSL
<csl_dev@hotmail.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)
Closed Thread