473,399 Members | 4,177 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,399 software developers and data experts.

File Copy to Hidden Share

Hi all,
I just written a app that attemps to copy a user selected file to a
bunch of users machines.

Trouble is that when call System.IO.File.Copy( src , dest , true ) i get a
Unauthorised Access Exception thrown. dest is would be something like

"\\UserMachine01\c$\localScripts\theFile.vbs"

if i actually browse using explorer to the required path the app then works,
for the machines that i've browsed to. So I CAN have persmission to copy the
file.

How do I do this in code? I obviously don't want to have the final
user(another admin) have to open up 50 explorers just to get the privledges.

I gather the 'grant' comes from me being a member of domain admins , and
domain admins being a member of local administrators on the individual
machines. And this is not negotiated automatically by a simple file copy.

Adrian
Nov 23 '05 #1
2 2196
ooops! ReadOnly Attribute had been set!

"AdrianJMartin" <Ad***********@newsgroups.nospam> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
Hi all,
I just written a app that attemps to copy a user selected file to a
bunch of users machines.

Trouble is that when call System.IO.File.Copy( src , dest , true ) i get a
Unauthorised Access Exception thrown. dest is would be something like

"\\UserMachine01\c$\localScripts\theFile.vbs"

if i actually browse using explorer to the required path the app then
works, for the machines that i've browsed to. So I CAN have persmission to
copy the file.

How do I do this in code? I obviously don't want to have the final
user(another admin) have to open up 50 explorers just to get the
privledges.

I gather the 'grant' comes from me being a member of domain admins , and
domain admins being a member of local administrators on the individual
machines. And this is not negotiated automatically by a simple file copy.

Adrian

Nov 23 '05 #2
Hi Adrian,

We are glad to know that the problem is resolved now. Have a nice day!

Best Regards,

Terry Fei[MSFT]
Microsoft Community Support
Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Nov 23 '05 #3

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

Similar topics

2
by: phantom | last post by:
Hi all, Heres a strange problem i am running into running Php4.2.2. I am uploading a file using a post and when i receive the file on my share the file adds some more records to it ( These are...
5
by: Dave Smithz | last post by:
Hi There, I have a PHP script that sends an email with attachment and works great when provided the path to the file to send. However this file needs to be on the same server as the script. ...
2
by: nek | last post by:
Seasons greetings, Platform is W2K SP4, DB2 V8.1 FP2. A few days ago I posted the question to globally 'update db cfg' for all servers which could be done via a script thanks to Ian and PM's...
1
by: Wayne Aprato | last post by:
Is there an effective method of preventing users from accidentally or maliciously deleting the database file/files from a shared network drive? At the moment, I'm using a batch file to copy the...
5
by: Washington | last post by:
Is possible to copy file from some server for. e.g. brinkster to computer (on specified location) programmatically? I am trying to make some automatic update of my application... Thanks :)
13
by: Alexandra | last post by:
Hi, I have a hidden system file that I need to read. I am logged in as an administrator. I can not change the file attributes using the windows explorer.
2
by: Glen Conway | last post by:
Hi, I am trying to get the contents of a file in a hidden share on a remote server, something like '\\server.domain.com\c$\program files\application\document.xml'. When I try any of the...
5
by: Standist | last post by:
I want install software on PC in my local network. First I want copy file to the PC through default share like c$ or d$ on the PC. Then install the software through wmi. I have the administrator...
4
by: Jim Michaels | last post by:
after a file upload, $_FILES is not populated but $_POST is. what's going on here? $_POST=C $_POST=C $_POST=C $_POST=C:\\www\\jimm\\images\\bg1.jpg $_FILES= $_FILES= $_FILES=
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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...
0
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,...
0
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...

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.