473,394 Members | 1,841 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,394 software developers and data experts.

how to remove "Read Only" from file on remote server

How to remove "Read Only" status on a file on a remote server?

My goal is to delete the file, but

System.File.Delete(\\machine1\c$\folder1\file1.txt )

is giving me an "Access is denied" error.

My log-on account is member of MACHINE1's local Administrators group.
Nov 17 '05 #1
1 10654
On Thu, 28 Apr 2005 18:28:05 -0700, John Grandy wrote:
How to remove "Read Only" status on a file on a remote server?

My goal is to delete the file, but

System.File.Delete(\\machine1\c$\folder1\file1.txt )

is giving me an "Access is denied" error.

My log-on account is member of MACHINE1's local Administrators group.


To remove an attribute use System.IO.File.SetAttributes. Ex:

System.IO.FileAttributes atts =
System.IO.File.GetAttributes(@"\\machine1\c$\folde r1\file1.txt");
atts &= ~System.IO.FileAttributes.ReadOnly;
System.IO.File.SetAttributes(@"\\machine1\c$\folde r1\file1.txt", atts);
--
Tom Porterfield
Nov 17 '05 #2

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

Similar topics

1
by: Fie Fie Niles | last post by:
I have IIS installed on XP Professional workstation machine. I have an ASP page that open connection to an Access database, then when trying to update the database, it gave me the error "cannot...
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...
1
by: Poseidon | last post by:
I use "read" method to read some blocks into a buffer from a filestream, and send data in the buffer to remote server with "send" method of cocket class. For certain computers, I have to add "sleep"...
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...
1
by: Jason | last post by:
Hi, Does anyone know how I can connect to an MSDE db using VB with a read-only file? The file will be on a CD, and is actually just archived data off a SQL server. I would like to package my app...
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...
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....
2
by: James | last post by:
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?...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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...

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.