Code Error 800A0046 – Permission Denied

Troubleshooting Code 800A0046 – Permission Denied

Code 800A0046 is a straightforward error to solve.  The secret is to read the Windows Script Error message carefully, then check the access control list to see who has permission to use the page, or use the device.


Introduction to Error 800A0046

Code 800A0046 is runtime error that is more likely to occur with an .ASP file than a .VBS.  You could be trying to connect to SQL, IIS or Exchange.  However, my example of is taken from printer permission problem sent in by Keith S.Code Error 800A0046 Permission Denied

The Symptoms You Get With Error 800A0046

When you get a pop-up message box.  Put on your detective hat, and pay close attention to the line number.  Error 800A0046 is a runtime error, so the problem is likely to outside your script, there could be something the matter with permissions on an application server.

The Cause of Error 800A0046

In the example above, Line 6: is the source of the error.  Char 1: is not always very useful as the error could be anywhere on the line, and WSH still blames char 1.

The cause of error 800A0046 is likely to be read-only permissions on some aspect of your server.  The Source: tells us that this is a runtime error, therefore the syntax is probably o.k.

The Solution

If its Exchange, then check the MailRoot and Pickup folder permissions.  If its IIS check the permissions to run scripts.  If its SQL check the execute permissions on the services.

The solution in the printer problem below would be to change the share permissions on the HP6L printer share.

Example 1: Script to map a printer

In this example, the user does not have permission to install the HP6L printer. Tell the truth, an example script is not that useful with Error 800A0046 as you cannot see the permissions!

‘  VBScript to create a local printer mapped to a network server
‘  Guy Thomas February 2010.
Option Explicit
Dim netPrinter
Set netPrinter = CreateObject("WScript.Network")
netPrinter.AddWindowsPrinterConnection "\\ServerPrn\HP6L"

Guy Recommends: Permissions Analyzer – Free Active Directory ToolFree Permissions Analyzer for Active Directory

I like thePermissions Monitor because it enables me to see quickly WHO has permissions to do WHAT.  When you launch this tool it analyzes a users effective NTFS permissions for a specific file or folder, takes into account network share access, then displays the results in a nifty desktop dashboard!

Think of all the frustration that this free utility saves when you are troubleshooting authorization problems for users access to a resource.  Give this permissions monitor a try – it’s free!

Download Permissions Analyser – Free Active Directory Tool

Example 2: Error 800A0046 When You Install Visual Studio 6.0 (Also other Microsoft Products)

When you install Visual Studio you get the following message.

Permission denied: ‘CreateObject’

/Retail/include/global_siteconfig_lib.asp, line 194

Once again it’s a permissions problem on the Windows\system32 folder.  Another idea is to try the useful Free Permissions Analyzer.

Example 3: ASP on IIS (Kindly sent in by a reader)

The way we got error 800A0046 was running ASP on IIS under Server 2003R2. Someone wrote a debug routine that did an OpenTextFile from a FileSystemObject; I think what happened was there were multiple simultaneous attempts to open that file.

Example 4: Constantly Writing to File

Dim oFS
Set FSO = CreateObject("Scripting.FileSystemObject")
Set oFS = FSO.GetFile("d:\test\o2\test.png")
IF oFS.Attributes AND F_ATTR_RONLY ‘check if bit 1 is set – read only
‘do nothing
FSO.CopyFile "d:\test\o1\test.png", "d:\test\o2\"

The problem was: the file is written into the sourcelocation every 10 seconds. This is done by a Closed Source Software i have no way of editing. It seems like i get the error (line 11) every time i try to READ the sourcefile while it is being written/created.
Sadly the only solution i found was to run the script with
c:\windows\system32\wscript.exe "c:\{path to script}" //B
preventing the errornotice.

I have found no way to check if the file is currently being modified except for try and error.


See More Windows Update Error Codes 8004 Series

Error 800A101A8 Object Required   •Error 800A0046   •Error 800A10AD   •Error 800A000D

Error 80048820   •Error 800A0401   •Review of SolarWinds Permissions Monitor

Error 80040E14   • Error 800A03EA   • Error 800A0408   • Error 800A03EE

Solarwinds Free WMI MonitorGuy Recommends: WMI Monitor and It’s Free!

Windows Management Instrumentation (WMI) is one of the hidden treasures of Microsoft operating systems.  Fortunately, SolarWinds have created the WMI Monitor so that you can examine these gems of performance information for free.  Take the guess work out of which WMI counters to use for applications like Microsoft Active Directory, SQL or Exchange Server.

Download your free copy of WMI Monitor

Do you need additional help?

Give something back?

Would you like to help others?  If you have a good example of this error, then please email me, I will publish it with a credit to you:

If you like this page then please share it with your friends