473,491 Members | 2,074 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

network folder is read-only even though file attribute says its writeable

I am familiar with using My.Computer.FileSystem.GetDirectoryInfo to get folder attributes, see code below...
This does not work though for network drives on my companies system.
We use windows as our server, nothing exotic.
I looked at the security permissions and the "write" box for domain users was grey, but not checked.
This means read-only to me and sure enough, I cannot change the files.
Is there a different way to deal with permissions controlling read-write property of folders?
thanks

Public Function IsFldrReadOnly(ByVal path As String) As Boolean
Dim reader As System.IO.DirectoryInfo
reader = My.Computer.FileSystem.GetDirectoryInfo(path)
If (reader.Attributes And System.IO.FileAttributes.ReadOnly) 0 Then
Return True
Else
Return False
End If
End Function
Jan 29 '07 #1
3 4802
James,

You're company have have applied a security policy to the network drives as
a precaution.

Bruce

"James Maeding" <jm******@nettaxi.comwrote in message
news:vg********************************@4ax.com...
>I am familiar with using My.Computer.FileSystem.GetDirectoryInfo to get
folder attributes, see code below...
This does not work though for network drives on my companies system.
We use windows as our server, nothing exotic.
I looked at the security permissions and the "write" box for domain users
was grey, but not checked.
This means read-only to me and sure enough, I cannot change the files.
Is there a different way to deal with permissions controlling read-write
property of folders?
thanks

Public Function IsFldrReadOnly(ByVal path As String) As Boolean
Dim reader As System.IO.DirectoryInfo
reader = My.Computer.FileSystem.GetDirectoryInfo(path)
If (reader.Attributes And System.IO.FileAttributes.ReadOnly) 0
Then
Return True
Else
Return False
End If
End Function

Jan 30 '07 #2
right, no question about it.
Does everone get around this by trying to write a file to the folder as a test?
I did that and it works well, but its not elegent to say the least.
code:

Public Function IsFldrReadOnly(ByVal path As String) As Boolean
Dim ret As Boolean = True
Try
Dim file As System.IO.FileStream
file = System.IO.File.Create(path & "\TestDummy1234.txt")
file.Close()
System.IO.File.Delete(path & "\TestDummy1234.txt")
ret = False
Catch ex As Exception
End Try
Return ret
End Function

"Bruce W. Darby" <kr******@atcomcast.net>
|>James,
|>
|>You're company have have applied a security policy to the network drives as
|>a precaution.
|>
|>Bruce
|>
|>"James Maeding" <jm******@nettaxi.comwrote in message
|>news:vg********************************@4ax.com. ..
|>>I am familiar with using My.Computer.FileSystem.GetDirectoryInfo to get
|>>folder attributes, see code below...
|>This does not work though for network drives on my companies system.
|>We use windows as our server, nothing exotic.
|>I looked at the security permissions and the "write" box for domain users
|>was grey, but not checked.
|>This means read-only to me and sure enough, I cannot change the files.
|>Is there a different way to deal with permissions controlling read-write
|>property of folders?
|>thanks
|>>
|>Public Function IsFldrReadOnly(ByVal path As String) As Boolean
|> Dim reader As System.IO.DirectoryInfo
|> reader = My.Computer.FileSystem.GetDirectoryInfo(path)
|> If (reader.Attributes And System.IO.FileAttributes.ReadOnly) 0
|>Then
|> Return True
|> Else
|> Return False
|> End If
|> End Function
|>
Jan 30 '07 #3
James,

Wish I had an answer for you. Security policies are notorious for getting in
the way of good folks trying to do their work while not seeming to foil too
many folks that are trying to do a dastardly thing. I'm familiar with them
only because my job entails working with customer's whose IT dept has a
policy in place. The only way that I'm aware that this issue can be resolved
is for the folks that made the policy in the first place need to allow you
to modify the policy or bypass it in certain development areas so that you
can accomplish your task. Perhaps someone else here can give you a better
alternative.

Bruce
"James Maeding" <jm******@nettaxi.comwrote in message
news:lk********************************@4ax.com...
right, no question about it.
Does everone get around this by trying to write a file to the folder as a
test?
I did that and it works well, but its not elegent to say the least.
code:

Public Function IsFldrReadOnly(ByVal path As String) As Boolean
Dim ret As Boolean = True
Try
Dim file As System.IO.FileStream
file = System.IO.File.Create(path & "\TestDummy1234.txt")
file.Close()
System.IO.File.Delete(path & "\TestDummy1234.txt")
ret = False
Catch ex As Exception
End Try
Return ret
End Function

"Bruce W. Darby" <kr******@atcomcast.net>
|>James,
|>
|>You're company have have applied a security policy to the network drives
as
|>a precaution.
|>
|>Bruce
|>
|>"James Maeding" <jm******@nettaxi.comwrote in message
|>news:vg********************************@4ax.com. ..
|>>I am familiar with using My.Computer.FileSystem.GetDirectoryInfo to get
|>>folder attributes, see code below...
|>This does not work though for network drives on my companies system.
|>We use windows as our server, nothing exotic.
|>I looked at the security permissions and the "write" box for domain
users
|>was grey, but not checked.
|>This means read-only to me and sure enough, I cannot change the files.
|>Is there a different way to deal with permissions controlling
read-write
|>property of folders?
|>thanks
|>>
|>Public Function IsFldrReadOnly(ByVal path As String) As Boolean
|> Dim reader As System.IO.DirectoryInfo
|> reader = My.Computer.FileSystem.GetDirectoryInfo(path)
|> If (reader.Attributes And System.IO.FileAttributes.ReadOnly) >
0
|>Then
|> Return True
|> Else
|> Return False
|> End If
|> End Function
|>

Jan 31 '07 #4

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

Similar topics

4
1649
by: Marc Miller | last post by:
Is it possible in a webform to read Novell Network shares? I have need to read the name of a folder under our user's 'H:' or UNC path \users folder. Also I have need to copy files and output to...
11
1299
by: Jessard | last post by:
Hi all, This seems like a really simple question but I don't think there is a simple answer. If there is I'd be glad to hear it. I am trying to create a folder, yep, that's all. I can do it...
1
5850
by: Tardus Merula | last post by:
We have just put a new samba server on the lab premises and upgradede all workstations to 100 MB/s, in order to avoid using 10-mile radio link, hoping that this would enable us to operae our...
0
955
by: Dennis | last post by:
I have a shared folder on my network of 2 computers, "\\computer2\sharedocs" that has sharing set to read and write both. When I use new DirectoryInfo("\\computer2\sharedocs"), I get the value of...
5
13241
by: Mitchell S. Honnert | last post by:
Is there a way, given the full path of a folder on a network, that one can programatically tell if you have Read access to that folder? I have an application where the user is able to select a...
3
2172
by: dotnettester | last post by:
Hi, I'm trying to read a network drive through ASP.net. This is what I have done. - Create folder on a network machine. - gave ASPNET_User read permssion on the folder. - Mapped a drive to the...
3
941
by: Elton Cohen | last post by:
Sorry for asking again. I know it's now a specific VB topic, but since this ng is my home, I dare to ask again: Can anyone please tell me the most simple way to enable 2 or more pcs to share one...
0
1398
by: ColdCoffee | last post by:
Scenario: My computer: name : PrasComp pass : Pras123 Domain : XYZ Computer I wanna access: Name : AnoComp pass : #Pras
4
5699
by: chu2ch | last post by:
Good Afternoon Folks, Im kinda in a pickle. I have created a .net 2.0 dll written in vb.net that needs to reside in a folder on a networked computer ( for compatibility with another program)....
0
4249
by: Eran.Yasso | last post by:
Hi all, The following code sets/disables network adpter's status. Since I have no idea where to put this code and I wish to share the community with it. I did rverse engineering from VBS to C#....
0
7115
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
6978
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
7360
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
4578
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3086
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3076
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1392
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
633
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
280
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.