I have a few workstations that can't run a network script for mapping network drives etc. I know the script works as it's working for everyone else.

But on 1 or 2 machines (out of 1000) the script won't run at all. I get an error "VBScript runtime error, error ID 800A046.

The script itself is fine, I'm pretty certain of that. Any ideas?

Also have tried as an admin account.

From line 501

      .Write "<span id='theEnd'></span>"
      Set oTheEnd = .all.theEnd
      .Title = sTitle

      With .ParentWindow.document.body
        .style.backgroundcolor = "LightBlue"
        .style.Font = "10pt 'Arial'"
        '.style.borderStyle = "outset"
        '.style.borderWidth = "4px"
        ' .scroll="no"
      End With
      oIE.Visible = True

    End With ' document
  End With   ' oIE
End Sub

Also worth noting this:

Function main()
    On Error Resume Next

    'Map "<group>" , "<drive>:" , "\\server\<share>"
    Map "DummyGroupName" , "R:" , "\\Servername\Sharename"  

Log File

' Create logfile
If appendlogfile=True Then WriteFlag = 8 Else WriteFlag = 2 End If
sSystemdrive = oShell.ExpandEnvironmentStrings("%USERPROFILE%")
Set logfile = oFSO.OpenTextFile (sSystemdrive & "\logon.log", WriteFlag, True)
logfile.Writeline "............................"
  • I think its a permissions error, if you post the section of the script that is causing the error we can look at it – beakersoft May 13 '11 at 10:34
  • what type of object is oTheEnd? what is the With block that line 501 is contained in? That error is definitely permission denied. – Paul D'Ambra May 13 '11 at 13:00
  • How can in it be permissions if the same user can use a different workstation and the script runs fine? – stead1984 May 13 '11 at 13:36
  • Just to clarify - the problem workstations won't run the script for anybody - admins included? – Kara Marfia May 13 '11 at 13:52
  • Thats right the problem workstation will not run the script regardless of who it is. I've tried 2 normal accounts and local admin accounts. @Kara Marfia – stead1984 May 13 '11 at 14:16

This error is permission denied. Unfortunately this could be from anywhere in the script not just the linie it complains about. Since you know that the problem is on the workstation and not the drive mapping, I would think that the problem is permissions on DCOM or a directory on the local workstation. You mention that they can't run any scripts I would first try reinstalling vbscript to see if that solves the problem.

On a side note if this is mapping drives why not use group policy preferences and eliminate the script altogether?

  • Thanks Jim B, how you uninstall vbscript? I have asked that question elsewhere. – stead1984 May 23 '11 at 11:15
  • I don;t know how to uninstall as it is a part of windows but you can download the latest version which would reinstall the components for XP here : microsoft.com/downloads/en/… – Jim B May 23 '11 at 19:38
  • Ok cool, how do I set permissions on DCOM and what exactly should I grant access to? – stead1984 May 24 '11 at 7:46
  • did installing the latest vbscript fail? – Jim B May 24 '11 at 13:21
  • Yes that failed. – stead1984 Jun 17 '11 at 7:44

Check this article out. I agree in that it sounds like a permissions issue with mapping the drives or whatever else it is that your network logon script is trying to do.


  • logon as a normal user, start filemon with elevated rights (www.sysinternals.com), run the script and filemon should show you were you get your access being denied. – djl236 May 13 '11 at 12:31
  • Ok I'll give that a try. – stead1984 May 13 '11 at 13:32
  • I didn't see any errors or access denied in filemon. – stead1984 May 16 '11 at 8:05

I note that the line before the line you mention throws the error is .Close ...

So it looks like you are closing something and then referencing it.

Try moving .Close after .title = sTitle

Although it's difficult to be sure without seeing more of the script.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.