Results 1 to 5 of 5
  1. #1
    Lounger
    Join Date
    Aug 2002
    Location
    Boise, Idaho, USA
    Posts
    38
    Thanks
    0
    Thanked 0 Times in 0 Posts

    'scripting' and File System object (VBA/Excel 2000)

    Is the File System object (Scripting.FileSystemObject) related in some way to the Windows Scripting Host? Should I avoid its use if I expect my users to avoid WSH for security reasons?

  2. #2
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Weert, Limburg, Netherlands
    Posts
    4,812
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: 'scripting' and File System object (VBA/Excel 2000)

    I guess the answers are Yes, Yes. But I'm not completely sure.
    Jan Karel Pieterse
    Microsoft Excel MVP, WMVP
    www.jkp-ads.com
    Professional Office Developers Association

  3. #3
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Dublin, Ireland, Republic of
    Posts
    2,697
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: 'scripting' and File System object (VBA/Excel 2000)

    The FileSystem Object is part of Microsoft's scripting technology, but is all contained with a DLL (sccrun.dll) and is not intrinsically linked with the Windows Scripting Host. It is possible to disable WSH but retain sccrun.dll on your system just like any other DLL. You can then access it via VB or VBA etc.

    Andrew C

  4. #4
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: 'scripting' and File System object (VBA/Excel 2000)

    Another way to think about this is: all scripts need a host. Internet Explorer can be the host; Outlook Forms can be the host; ASP can be the host; a VBA-aware application can be the host; or the Windows Script Host can be the host. Removing WScript.exe, and the WScript.Object entries in the Registry, will prevent any script from being hosted by the Windows Script Host, and will limit the potential access scripts have to the system from other hosts. But it should leave Scripting.FileSystemObject intact. Of course, it's possible that someone will remove that, too...

    The alternatives to the FileSystemObject include the rudimentary Basic commands, and a large family of Windows API calls. I believe that one of my seldom-used VBA books came with a class library that nicely wrapped these calls, or maybe I saw it (or a link to it) posted here. It's definitely one of those things to wrap once and reuse often, to avoid the crashes that can occur with inadequately debugged DLL calls.

  5. #5
    Super Moderator
    Join Date
    Dec 2000
    Location
    New York, NY
    Posts
    2,970
    Thanks
    3
    Thanked 29 Times in 27 Posts

    Re: 'scripting' and File System object (VBA/Excel 2000)

    Not really pertinent to Excel 2000, but also worth mentioning is that in the .NET Framework, properties and methods previously available via FileSystemObject, have been folded into the System.IO namespace, making them easily available.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •