VBS run command error when program denied in GPO

Well the subject pretty much nails it: I have a .vbs script that sends an email and then at the end has this line:
CreateObject("WScript.Shell").Run("""my program.exe""")

This script works great EXCEPT for when the logged-in user has this program denied in group policy; when that is the case the user gets an error:
Error: 0xFFFFFFFF
Code: FFFFFFFF
Source: (null)

And then never gets the standard windows "This program has been denied by policy" window. The program does not start (it shouldn't) but then every-single-user-who-does-this comes and tells me there is an error... :(

I understand that the GPO denial is throwing the vbs error, but is there a way to allow the system error to be displayed instead? or maybe a custom error message from  the vbs script? I am not a vbs guy, just making good use of a simple fix...
steamngnAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

gheistCommented:
Add this to your VBS file to conceal errors:

On Error Resume Next

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
cantorisCommented:
As well as just swallowing the error silently with an
On Error Resume Next
you need to detect the error immediately after attempting the command using
If Err.Number <> 0 Then
You could then do whatever type of alert you want.
The MsgBox command will pop up a message and wait indefinitely.
Alternatively use  objWshShell.Popup to display a messagebox for a fixed period of time before closing it automatically.  objWshShell being created with WScript.CreateObject("WScript.Shell").
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
VB Script

From novice to tech pro — start learning today.