By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,636 Members | 1,915 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,636 IT Pros & Developers. It's quick & easy.

Shell function in A97

P: n/a
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)
Nov 13 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
On Wed, 15 Sep 2004 16:03:50 +0100, Les Desser
<Ne*******@dessergroup.com> wrote:

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

-Tom.
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.


Nov 13 '05 #2

P: n/a
In article <fj********************************@4ax.com>, Tom van
Stiphout <no*************@cox.net> Thu, 16 Sep 2004 06:46:16 writes
On Wed, 15 Sep 2004 16:03:50 +0100, Les Desser
<Ne*******@dessergroup.com> wrote:
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
Enter this in a command window:
cmd /?
You'll learn about the /K command line argument.

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)
Nov 13 '05 #3

P: n/a
CSL
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!
Nov 13 '05 #4

P: n/a
In article <41**********************@news.newsgroups.ws>, CSL
<cs*****@hotmail.com> Mon, 20 Sep 2004 09:50:49 writes
this is the part of code I use for the SHELL.


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)
Nov 13 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.