473,594 Members | 2,747 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.Del ete(\\machine1\ c$\folder1\file 1.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 10663
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.Del ete(\\machine1\ c$\folder1\file 1.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.FileA ttributes atts =
System.IO.File. GetAttributes(@ "\\machine1\c$\ folder1\file1.t xt");
atts &= ~System.IO.File Attributes.Read Only;
System.IO.File. SetAttributes(@ "\\machine1\c$\ folder1\file1.t xt", 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
3946
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 update database or object is read-only". This is a workstation machine, not connected to any other computer, and I login to the PC using an administrator account. I already check the .MDB file is NOT read-only. But, I do not see the .LDB file....
0
2748
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 ".frm" file for every table in the database. So after creating a database called "tracerlock" on the new server, I copied these files over to the /var/lib/mysql/tracerlock directory on the new server. On both servers, all the table files are owned...
1
1513
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" commands after read, otherwise no data is sent to remote server Who can help me how to check if the data are filled into the buffer fully after read?
10
2272
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 supposed to change the buffer size and see how this affects the read time. In other words, the buffer is supposed to limit how much of the file gets read per call, and cause some change in speed. I am supposed to do the same with fread as well, but...
1
1921
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 on a CD along with the data file and allow users to pop in the CD and run the app, assuming they already have MSDE running. Any help? Thanks, Jason
3
2160
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 via the two forms I need but not change anything. Why? The command line for the user to access the file is simply as follows (from advice via msdn.microsoft.com) "C:\MS Runtime\Office10\MSACCESS.EXE" "Q:\QA Records Database\Vaccine...
0
1252
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. The files in question do not have the Read-Only Attribute on. Any Ideas?
2
1495
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? Thank you.
3
4324
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 SQL when I try and import it comes back with
0
7947
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
7880
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8255
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8374
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
6665
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
5739
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
3903
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1486
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1217
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.