The following is a direct quote for the Windows 2000 Scripting Guide

<begin quote>
Be aware that verbs always function in exactly the same way they do
when clicked in Windows Explorer. If you right-click a file and select
Open, the file automatically opens. If you select Delete, however, a
confirmation box is displayed before the file is deleted. This same
confirmation box appears if you attempt to delete any object using
InvokeVerbEx. For example, using the Delete verb on a file results in
a dialog box similar to the one shown in Figure 11.8.


By comparison, right-clicking a file and selecting Print does not
display a dialog box; instead, the file is automatically printed to
the default printer. If you use InvokeVerbEx to print a file
programmatically, that file is automatically printed to the default
printer without displaying a dialog box of any kind.
</end quote>


And here is the sample code:
TargetFolder = "C:\Logs"
set objShell = CreateObject("Shell.Application")
set objFolder = objShell.Namespace(TargetFolder)
set colItems = objFolder.Items
for each objItem in colItems
wscript.echo objItem.Name
objItem.InvokeVerbEx("Print")
next


Contrary to what is printed a dialog box DOES appear for "every" file
print. I can not seem to find any information on the optional
parameter.

Does anyone know of a way to make InvokeVerbEx perform as documented -
I want to invoke the print verb on a file without any user
intervention.

Thanks
Lee

Re: Help with InvokeVerbEx needed by Lee

Lee
Wed Aug 17 12:07:09 CDT 2005

One other note - I need the print a .hta (.html) file, so simply using
notepad /p won't work.

Thanks
Lee

On Wed, 17 Aug 2005 17:04:14 GMT, Lee Peedin
<lpeedinREMOVE@UPPERCASEnc.rr.com> wrote:

>The following is a direct quote for the Windows 2000 Scripting Guide
>
><begin quote>
>Be aware that verbs always function in exactly the same way they do
>when clicked in Windows Explorer. If you right-click a file and select
>Open, the file automatically opens. If you select Delete, however, a
>confirmation box is displayed before the file is deleted. This same
>confirmation box appears if you attempt to delete any object using
>InvokeVerbEx. For example, using the Delete verb on a file results in
>a dialog box similar to the one shown in Figure 11.8.
>
>
>By comparison, right-clicking a file and selecting Print does not
>display a dialog box; instead, the file is automatically printed to
>the default printer. If you use InvokeVerbEx to print a file
>programmatically, that file is automatically printed to the default
>printer without displaying a dialog box of any kind.
></end quote>
>
>
>And here is the sample code:
>TargetFolder = "C:\Logs"
>set objShell = CreateObject("Shell.Application")
>set objFolder = objShell.Namespace(TargetFolder)
>set colItems = objFolder.Items
>for each objItem in colItems
> wscript.echo objItem.Name
> objItem.InvokeVerbEx("Print")
>next
>
>
>Contrary to what is printed a dialog box DOES appear for "every" file
>print. I can not seem to find any information on the optional
>parameter.
>
>Does anyone know of a way to make InvokeVerbEx perform as documented -
>I want to invoke the print verb on a file without any user
>intervention.
>
>Thanks
>Lee
>


Re: Help with InvokeVerbEx needed by Lee

Lee
Wed Aug 17 13:13:02 CDT 2005

Nevermind - I found my answer.

Seems Microsoft (in their infinate wisdom) has decided that printing
.htm/.html files is a "security risk" and therefore pops us the select
printer dialog. This doesn't happen with .xls/.doc/.txt type files.

Thanks anyway
Lee

On Wed, 17 Aug 2005 17:07:09 GMT, Lee Peedin
<lpeedinREMOVE@UPPERCASEnc.rr.com> wrote:

>One other note - I need the print a .hta (.html) file, so simply using
>notepad /p won't work.
>
>Thanks
>Lee
>
>On Wed, 17 Aug 2005 17:04:14 GMT, Lee Peedin
><lpeedinREMOVE@UPPERCASEnc.rr.com> wrote:
>
>>The following is a direct quote for the Windows 2000 Scripting Guide
>>
>><begin quote>
>>Be aware that verbs always function in exactly the same way they do
>>when clicked in Windows Explorer. If you right-click a file and select
>>Open, the file automatically opens. If you select Delete, however, a
>>confirmation box is displayed before the file is deleted. This same
>>confirmation box appears if you attempt to delete any object using
>>InvokeVerbEx. For example, using the Delete verb on a file results in
>>a dialog box similar to the one shown in Figure 11.8.
>>
>>
>>By comparison, right-clicking a file and selecting Print does not
>>display a dialog box; instead, the file is automatically printed to
>>the default printer. If you use InvokeVerbEx to print a file
>>programmatically, that file is automatically printed to the default
>>printer without displaying a dialog box of any kind.
>></end quote>
>>
>>
>>And here is the sample code:
>>TargetFolder = "C:\Logs"
>>set objShell = CreateObject("Shell.Application")
>>set objFolder = objShell.Namespace(TargetFolder)
>>set colItems = objFolder.Items
>>for each objItem in colItems
>> wscript.echo objItem.Name
>> objItem.InvokeVerbEx("Print")
>>next
>>
>>
>>Contrary to what is printed a dialog box DOES appear for "every" file
>>print. I can not seem to find any information on the optional
>>parameter.
>>
>>Does anyone know of a way to make InvokeVerbEx perform as documented -
>>I want to invoke the print verb on a file without any user
>>intervention.
>>
>>Thanks
>>Lee
>>