Computer Performance, Logon Scripts

Code Error 800A004C - Path not found

Troubleshooting Code 800A004C - Path not found

For once error 800A004C is not the VBScript's fault.  Check the name of the file and or folder referenced in the script.

Introduction to Error 800A004C

Error 800A004C occurs when you execute a VBScript.  My suggestion is that you are trying to read, or write, to a file reference that does not exist.  A wild guess, there is a typo in your Path statement.Code 800A004C Error - Path not found.   VBScript Microsoft

The Symptoms you get 800A004C

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

The Cause of Error 800A004C

In the example above, Line 12: is the source of the error.  Char 1: is not always very useful as the error could be anywhere on the line and char 1 will be blamed by WSH. (Windows Script Host)

The cause of error 800A004C is likely to be that the folder that you wish to create the file does not exist.  The VBScript is capable of creating the file, but there is no such directory.

The Solutions

Amend the script to reference a real folder.  Create a folder to match the path in your script.

Incidentally, Source: reports a runtime error not a compilation error, this means you are looking not for a pure syntax problem, but a fault logic error.  In the case of runtime errors, you can use this temporary work around.  Add this statement just before the line which errors: On Error Resume Next.

Example of Error 800A004C

In this example folder ezine39 does not exist.  (It should have been ezine35)

strPath = "E:\ezine\scripts\ezine39\ServicesManual.txt"
 

 

' ServicesManual.vbs - Writes services to a file.
' Author Guy Thomas http://computerperformance.co.uk/
' Version 3.7 - June 27th 2004
' -------------------------------------------------------------'
Option Explicit
Dim objfso, objWMIService, objItem, colItems
Dim strPath, strFile, strComputer

strPath = "E:\ezine\scripts\ezine39\ServicesManual.txt"
strComputer = "."
Set objfso = CreateObject("Scripting.FileSystemObject")
Set strFile = objfso.CreateTextFile(strPath, True)
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_Service",,48)
For Each objItem in colItems

If objItem.StartMode = "Manual" Then

strFile.WriteLine("DisplayName: " & objItem.DisplayName)
strFile.WriteLine("Name: " & objItem.Name)
strFile.WriteLine("PathName: " & objItem.PathName)
strFile.WriteLine("ServiceType: " & objItem.ServiceType)
strFile.WriteLine("Started: " & objItem.Started)
strFile.WriteLine("StartMode: " & objItem.StartMode)
strFile.WriteLine("State: " & objItem.State)
strFile.WriteLine("Status: " & objItem.Status)

strFile.WriteLine("")
End if

Next
strFile.Close

Wscript.Quit

' End of Script
 

 

Solarwinds IpMonitorTry a different solution, download SolarWinds ipMonitor

Here is my thinking, ipMonitor will give you valuable data about your network and servers.  This extra information just may unlock the solution to your error code.  One more thing, sometimes when troubleshooting you go around in circles; therefore if you try a different, but related approach, you may just crack the problem.  Free Download of SolarWinds ipMonitor

Computer Training Software - Recommended Training VideosGuy Thomas recommends Computer Training Software

Their topics and material are ideal for getting you started with VBScript.  The videos are easy to follow and you can control the pace.  Try their free demo material and then see if you want to buy the full package. See more about VB Script Training CD.


Do you need extra help?

For interpreting the WSH messages check Diagnose 800 errors.

For general advice try my 7 Troubleshooting techniques

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:

 

 *


Google

WebComputerperformance.co.uk

GFi Events Manager

Guy Recommends: GFi EventsManager

Here is a solution to monitor, manage and archive thousands of events that are generated by devices across your entire network.  Get your free evaluation copy of GFI EventsManager.

 

Home Copyright © 1999-2008 Computer Performance LTD All rights reserved

Please report a broken link, or an error.