3 Replies - 2368 Views - Last Post: 10 April 2013 - 02:47 PM Rate Topic: -----

#1 ak4744710  Icon User is offline

  • D.I.C Head

Reputation: 2
  • View blog
  • Posts: 133
  • Joined: 30-January 13

Is access to the path C:\test.txt denied a security setting on 7

Posted 10 April 2013 - 10:39 AM

I am getting the following error when trying to use streamwrite and streamread on vb.net (Access to the path 'C:\test.txt' is denied.) I have been searching the net and all I can come up with is that it could mean you are not on an administrator account, but I am. Could someone tell me how to fix this I am assuming it is an error with my settings but I have no clue where to look any help is much appreciated.
Is This A Good Question/Topic? 0
  • +

Replies To: Is access to the path C:\test.txt denied a security setting on 7

#2 C.Andrews  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 14
  • View blog
  • Posts: 169
  • Joined: 18-October 12

Re: Is access to the path C:\test.txt denied a security setting on 7

Posted 10 April 2013 - 10:48 AM

View Postak4744710, on 10 April 2013 - 05:39 PM, said:

I am getting the following error when trying to use streamwrite and streamread on vb.net (Access to the path 'C:\test.txt' is denied.) I have been searching the net and all I can come up with is that it could mean you are not on an administrator account, but I am. Could someone tell me how to fix this I am assuming it is an error with my settings but I have no clue where to look any help is much appreciated.



You're running a-foul of User Account Control in Windows 7. You can either alter your settings from the User Accounts snap-in in the control panel, or move your text file to a sub-directory of C:\.
Was This Post Helpful? 1
  • +
  • -

#3 ak4744710  Icon User is offline

  • D.I.C Head

Reputation: 2
  • View blog
  • Posts: 133
  • Joined: 30-January 13

Re: Is access to the path C:\test.txt denied a security setting on 7

Posted 10 April 2013 - 10:53 AM

I figured out by playing around with it if I make a temp folder in c such as C:\vb\foldername it seems to work fine I wanted to post in case anyone has the same problem and comes across this post I never did figure a way to just add it to c but this works for me.

wow that came in while I was typing I guess lol thank you very much though C.Andrews
Was This Post Helpful? 0
  • +
  • -

#4 AdamSpeight2008  Icon User is offline

  • MrCupOfT
  • member icon


Reputation: 2270
  • View blog
  • Posts: 9,496
  • Joined: 29-May 08

Re: Is access to the path C:\test.txt denied a security setting on 7

Posted 10 April 2013 - 02:47 PM

You shouldn't have a problem if you use the Temp directory.
 Dim tmpDir = My.Computer.FileSystem.SpecialDirectories.Temp 


Accessed in a Windows OS Version agnostic way

This post has been edited by AdamSpeight2008: 10 April 2013 - 02:51 PM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1