Microsoft Vbscript Runtime Error 800a01c3
Contents |
800A01C3 - Object not a collection Introduction to Code 800A01C3 Error code, 800A01C3 occurs when you execute a WMI / VBScript. This is a
Enumkey Object Not A Collection
runtime error check the names of your objects.Go through the spelling quicktime uninstall script of the object names with a fine toothcomb. The Symptoms You Get The script does not execute as you hoped, instead you get a WSH error message. The Cause of Code 800A01C3 Your VBScript has a misspelled WMI object. Note: The clue Source: Microsoft VBScript runtime error. The actual error message is a little obscure, however it is alerting you the fact that WSH does not know a WMI object, which you have attempted to use.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.N.B. Jim C. reports it maybe a firewall setting on the client which prevents the script from running successfully. The Solutions Check the names in your script, pay particular attention to WMI objects. Note: The Line: 4 Char: 1 In this case it is not Char 1 to blame, more that there is something wrong and none of the line can execute. As a last resort, in the case of runtime errors, you can add this line: On Error Resume Next. Example1 of Error 800A01C3 Script Note: The Line: 4 objWMIService It should be objWMISystem strComputer = "Alan" set objWMIService = GetObject("Winmgmts:\\" & strComputer) set colOperatingSystems = objWMIService.InstancesOf("win32_OperatingSystem") For each objOperatingService In colOperatingSystems WScript.echo "Name " & objOperatingSystem.name & vbCRLf & _ "Caption " & objOperatingSystem.caption & vbcrlf & _ "Time Zone " & objOperatingSystem.currentTimeZone & vbcrlf & _ "OS Type " & objOperatingSystem.OsType Next © Example 2 Exchange User Randy C wrote in
United States Australia United Kingdom Japan Newsletters Forums Resource Library Tech Pro Free Trial Membership Membership My Profile People Subscriptions My stuff Preferences Send a message Log Out TechRepublic Search GO Topics: CXO Cloud Big Data Security Innovation Software Data Centers Networking Startups Tech & Work All Topics Sections: Photos Videos All Writers Newsletters Forums Resource Library Tech Pro Free Trial Editions: US United States Australia United Kingdom Japan Membership Membership My Profile People Subscriptions My stuff Preferences Send a message Log Out TechRepublic | Forums | Web Development Web Development Register Now or Log In to post Welcome back, My Profile Log Out http://www.computerperformance.co.uk/Logon/code/code_800A01C3.htm Recent Activity FAQs Guidelines Question 0 Votes Locked How to fix Error in script - "Object not a collection" 800A01C3? By ACox1976 · 5 years ago I'm trying to set up a renaming script but I'm getting an error at line 15, character 2 which says "Object not a collection" (error code 800A01C3). This is the script (numbered to make it easier to identify the error line):1 Const ForReading http://www.techrepublic.com/forums/discussions/how-to-fix-error-in-script-quotobject-not-a-collectionquot-800a01c3/ = 12 3 strComputer = "."4 Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")5 6 Set objFSO = CreateObject("Scripting.FileSystemObject")7 Set objFile = objFSO.OpenTextFile ("C:\Users\gzqj79\Desktop\Renaming.txt", ForReading)8 9 Do Until objFile.AtEndOfStream10 strLine = objFile.ReadLine11 arrParts = Split (StrLine, ",")12 strFile = "C:\\Photos\\" & arrParts(0)13 Set colItems = objWMIService.ExecQuery _14 ("Select * From CIM_Datafile Where Name = '" & StrFile & "'")15 For Each objItem in colItems16 strNewName = "C:\Photos\" & arrParts(1)17 objItem.Rename strNewName18 NEXT19 LOOP20 21 objFile.CloseAny help would be appreciated!Thanks -- Share Flag This conversation is currently closed to new comments. 4 total posts (Page 1 of 1) + Follow this Discussion · | Thread display: Collapse - | Expand + All Answers Collapse - Um. A guess by Tony Hopkinson · 5 years ago In reply to How to fix Error in scrip ... buthttp://technet.microsoft.com/en-us/library/ee176596.aspxThere's a third argument for ExecQquery called flags, one of them is return when complete, the default which you have is return immediate...Is this just 'playing/investigating', after all you have the old and new filenames, be easier to just execute a rename command, than mess about with WMI in this case. 0Votes Share Flag Collapse - Make sure your L and I are not mixed up by robo_dev · 5 years
von GoogleAnmeldenAusgeblendete FelderNach Gruppen oder Nachrichten suchen
von GoogleAnmeldenAusgeblendete FelderNach Gruppen oder Nachrichten suchen