locked
Error in CreateObject(Scripting.FileSystemObject) RRS feed

  • Question

  • I am getting an error in a .vbs file (and similar error in a .js file) when run from a Visual Studio batch file:

    Error in CreateObject(Scripting.FileSystemObject): ActiveX component can't create object. A code excerpt follows:

    Err.Clear
    on error Resume Next
    Set oFSO = CreateObject("Scripting.FileSystemObject")
    
    If Err.Number <> 0 Then
      WScript.Echo "Error in CreateObject(Scripting.FileSystemObject): " & Err.Description & " (so updating without regard to file modification times)"
      Err.Clear
      WScript.Sleep 2000
      bRun = 1
    End If
    

    This used to work, and the .vbs file will work fine if run from a command prompt. How can I narrow down the problem and correct?

    A JavaScript excerpt where a similar error occurs:

    function DetectAndMoveSettings(){
    	var fso = new ActiveXObject("Scripting.FileSystemObject"); << similar error here
    	var newSettings = Editor.pluginConfigDir+"\\jN.settings.js";
    	if (fso.FileExists(newSettings))
    		return;
    

    I am using Windows 7 64-bit.

    I know that my system files are intact (sfc /scannow), but maybe the registry is not.

    Regards,


    Frank

    Friday, May 24, 2013 6:32 PM

Answers

  • I solved the problem. I had to change the ownership of the problem registry to import the proper settings from a "good" PC.

    Frank

    • Marked as answer by OldGrouch Friday, June 7, 2013 4:40 PM
    Friday, June 7, 2013 4:40 PM

All replies

  • I believe the problem is related to this key:

    Windows Registry Editor Version 5.00

    [HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{0D43FE01-F093-11CF-8940-00A0C9054228}]
    @="FileSystem Object"

    and the fact that on my problem system there are no subkeys such as ProgID or TypeLib.

    Furthermore, I am getting an error when I try to import this key (exported from another system with proper entries). The error is not very specific, saying there may be a problem with the file - but the file is ok.

    If I try to change security to give administrators full control, I get an "access denied" error.

    How can I correct this problem?

    Regards,


    Frank

    Tuesday, June 4, 2013 9:20 PM
  • I solved the problem. I had to change the ownership of the problem registry to import the proper settings from a "good" PC.

    Frank

    • Marked as answer by OldGrouch Friday, June 7, 2013 4:40 PM
    Friday, June 7, 2013 4:40 PM