473,387 Members | 1,691 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Deleting "Read Only" files

Hello,
Whenever I try to delete a Read Only file using FileInfoObject.Delete I get
"Access to the path "File name and path" is Denied" error. This does not
happen with other files. Any ideas? Thank you.
May 1 '06 #1
2 1486
Change it to not be readonly first.

You can get whether or not it is readonly by checking the FileInfo object's
attributes

http://msdn2.microsoft.com/en-us/lib...ttributes.aspx

You can then set it to not be readonly using

http://msdn2.microsoft.com/en-us/lib...ttributes.aspx
A quick google also brought up
http://www.thescripts.com/forum/thread270312.html which also suggests using
WMI which supposedly does not have the same restriction.

Cheers,

Greg

"James" <ja***@nodomain.net> wrote in message
news:e$**************@TK2MSFTNGP03.phx.gbl...
Hello,
Whenever I try to delete a Read Only file using FileInfoObject.Delete I
get "Access to the path "File name and path" is Denied" error. This does
not happen with other files. Any ideas? Thank you.

May 1 '06 #2
Using SetAttributes did the trick. Thanks!


"Greg Young" <Dr*************@hotmail.com> wrote in message
news:eg**************@TK2MSFTNGP02.phx.gbl...
Change it to not be readonly first.

You can get whether or not it is readonly by checking the FileInfo
object's attributes

http://msdn2.microsoft.com/en-us/lib...ttributes.aspx

You can then set it to not be readonly using

http://msdn2.microsoft.com/en-us/lib...ttributes.aspx
A quick google also brought up
http://www.thescripts.com/forum/thread270312.html which also suggests
using WMI which supposedly does not have the same restriction.

Cheers,

Greg

"James" <ja***@nodomain.net> wrote in message
news:e$**************@TK2MSFTNGP03.phx.gbl...
Hello,
Whenever I try to delete a Read Only file using FileInfoObject.Delete I
get "Access to the path "File name and path" is Denied" error. This does
not happen with other files. Any ideas? Thank you.


May 1 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Bennett Haselton | last post by:
I'm trying to port my MySQL tables for a database called "tracerlock" from one server to another. On the old server, in the /var/lib/mysql/tracerlock directory, there was a ".MYD", ".MYI" and...
10
by: ZafT | last post by:
Thanks in advance for any tips that might get me going in the right direction. I am working on a simple exercise for school that is supposed to use read to read a file (about 10 MB). I am...
7
by: Rich | last post by:
Hi, I'm having problems with changing the Read Only properties. Running Winxp and i cannot get the "read only" to clear off a folder. The folder is one that i want to change the data in and it...
3
by: Stinky Pete | last post by:
I've mananged to get Access Run-time working on a Win 98 PC. I was stoked at that achievement, however I'm now stuck in that the files are opening Read only. That is, I can view all the records...
2
by: Michael A. Covington | last post by:
I want to deploy a project in which the user is provided with a set of READ-ONLY files to use as templates. They will be in a directory to which the user can add files of his own. It's...
0
by: John E Katich | last post by:
When attempt to use the Event Wizard I get the following error message: "Add/Remove of the function impossible, because the parent class code is read only" The Project was convert from VC 6.0....
1
by: John Layton | last post by:
Hi there, Does anyone know if there's a built-in way to read a ".txt" based resources file (one that's converted to a ".resources" file by "resgen.exe" at build time). I need to read/write the...
3
kickingthehabbit
by: kickingthehabbit | last post by:
Hi All new to all of this I just downloaded reactor server. everything works fine except Mysql - SQL import files. I am trying to import file createdb.sql I open DB and try and import with...
0
by: libish | last post by:
hi all, can any one help me in converting a directory to read only format. and also making a read only directory/file to read/write directory this is to avoid deleting a directory accidently.. ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.