1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Writing To A File

Discussion in 'Software Development' started by dhotrk, Apr 25, 2004.

Thread Status:
Not open for further replies.
Advertisement
  1. dhotrk

    dhotrk Thread Starter

    Joined:
    Jan 2, 2004
    Messages:
    26
    Hi,

    Im having trouble write to a text file.

    I am using the following code:

    *****************************************************
    Destination = "C:\Inetpub\wwwroot\dissertation\Week21SendEmails\Emails.txt"

    Set strWriteMessage = objFSO.OpenTextFile(Destination, 8, True)
    *****************************************************

    but am getting the following error:

    Microsoft VBScript runtime (0x800A0046)
    Permission denied

    on the Set strWriteMessage line.

    Can anyone please help??
    Many Thanks!
     
  2. Adam404

    Adam404

    Joined:
    Apr 26, 2004
    Messages:
    6
    looks like a permissions issue

    give the IUSR account write permissions to your 'Week21SendEmails' folder and it should work.
     
  3. dhotrk

    dhotrk Thread Starter

    Joined:
    Jan 2, 2004
    Messages:
    26
    Hi,

    Thanks for your response but I dont think that is the problem.

    I already checked the folder permissions and they are read / write already - I think that's what you meant, right?

    Any other ideas?

    Cheers
     
  4. dhotrk

    dhotrk Thread Starter

    Joined:
    Jan 2, 2004
    Messages:
    26
    Apologies!

    I have just realised that IUSR is something different.

    Please could you advise me on how to set these properties?

    Many Thanks
     
  5. Adam404

    Adam404

    Joined:
    Apr 26, 2004
    Messages:
    6
    what operating system are you using?

    for now ill asume you are working on windows 2000 or XP

    1.right click the 'Week21SendEmails' folder and select properties
    2.select the security tab and click add
    3.in the box where it says 'Enter the object names to select' enter IUSR_machinename, so if you computer is called Computer1 you would enter IUSR_Computer1, then click ok.
    4.the IUSR account should be in the userlist now, so just assign it read and write permissions for that folder.

    That should sort it out :)
     
  6. dhotrk

    dhotrk Thread Starter

    Joined:
    Jan 2, 2004
    Messages:
    26
    Thank you so much for getting back to me so quickly.

    Im using XP pro. I right clicked on the folder as you stated but i dont have a security tab. I have "General" "Sharing" "web sharing" and "Customise"
     
  7. Adam404

    Adam404

    Joined:
    Apr 26, 2004
    Messages:
    6
    hmm

    are you logged on as administrator?
     
  8. dhotrk

    dhotrk Thread Starter

    Joined:
    Jan 2, 2004
    Messages:
    26
    Hi Adam,

    I think i solved it. Basically I "shared" the web folder that the text file was stored in and this seems to have done the trick.

    Thank you so much for your help with this!

    Much appreciated :)
     
  9. Adam404

    Adam404

    Joined:
    Apr 26, 2004
    Messages:
    6
    no problem mate, glad you got it sorted out.
     
  10. Sponsor

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/223861

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice