PC Review


Reply
Thread Tools Rate Thread

Checking Drives for ReadOnly

 
 
=?Utf-8?B?RGVubmlz?=
Guest
Posts: n/a
 
      15th Aug 2004
Some time ago, I posed a queston in this newsgroup regarding how to determine
if a drive was readonly. The only way I had found was to try to create a
directory or file then chedk if an error was encountered. The replies were
that this was acceptable. However, it takes time to do this. Since I found
a way, which probably most know already but for those new to VB.Net, here it
is:

'Note r is a string equal to root directory on drive being checked, i.e.,
"d:\"
If (new directoryinfo(r).attributes and fileattributes.ReadOnly) > 0 then
'drive/storage is readonly
Else
'drive/storage can be written to
End If
--
Dennis in Houston
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Flash Drives ALL Readonly? =?Utf-8?B?RGFuaWVsV2FsdGVyczY=?= Windows XP Hardware 3 19th Jul 2007 05:29 PM
URGENT Folders on NTWK Drives ReadOnly -Can't Change =?Utf-8?B?R1NIdW1waHJleQ==?= Windows XP Networking 4 24th Sep 2006 07:25 AM
Error checking on drives Gamer Windows XP General 11 17th May 2006 11:58 PM
Checking RAID drives Colonel Blip Storage Devices 6 27th Feb 2006 02:01 AM
Checking DMA setup on disk drives Ron Windows XP New Users 1 15th Jun 2005 09:05 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:17 PM.