OpenTextFile & Error 424

Posted on 2004-11-03
Last Modified: 2012-08-13

On some clients when i execute this code

Set fso = CreateObject("Scripting.FileSystemObject")
SFolder = fso.GetSpecialFolder(1)
Set MyFile = fso.OpenTextFile(SFolder & "\drivers\etc\hosts", 8)

i get Error 424 there.

The path file exists and user permissions seem to be ok (anyway it should return an error 70)

Any idea ?

Question by:pofpof98
    LVL 26

    Expert Comment

    What's OS?

    You may want to download the script engine from
    LVL 6

    Accepted Solution

    I still think that you have a user permission problem, Check to make sure that the user has rights to read write and modify.
    LVL 14

    Expert Comment

    by:Shiju Sasidharan

    "hosts" is ur file name ?

    anywat try this

    ' Include the reference
    '                Microsoft Scripting Runtime
    Dim fso As New FileSystemObject
    Dim MyFile As TextStream
    Dim SFolder  as Folder
    SFolder = fso.GetSpecialFolder(1)
    Set MyFile = fso.OpenTextFile(SFolder & "\drivers\etc\hosts.txt", 8)




    Featured Post

    Do You Know the 4 Main Threat Actor Types?

    Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

    Join & Write a Comment

    Introduction While answering a recent question ( in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
    If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
    As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
    Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now