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

Copying Folders while maintaining permissions in ASP.NET 1.1

Good day everyone,

I've been searching for a solution to the problem of copying folders
using an ASP.NET on a windows 2000 server with .net 1.1. I have tried
using the directory class and the file system object and both
succesfully copy folders, however they do not maintain permissions.
Here is the sample code:

If (overwrite) Then
file.CopyTo(System.IO.Path.Combine(destDir.FullNam e,
file.Name), True)
Else
If
((System.IO.File.Exists(System.IO.Path.Combine(des tDir.FullName,
file.Name))) = False) Then

file.CopyTo(System.IO.Path.Combine(destDir.FullNam e, file.Name), False)
End If
End If
Next I tried using a batch file in conjunction with robocopy.exe
(http://www.ss64.com/nt/robocopy.html) however there seems to be a
restriction on ASP pages using the shell to execute server side
process.

sample:

CreateInquiryInfo.FileName = "robocopy.exe"

CreateInquiryInfo.WorkingDirectory = "C:\working\"

CreateInquiryInfo.Arguments = """C:\File Template"" ""C:\~New\" &
tLabel.Text & "\" & Label2.Text & """ /E /SEC /CREATE /V
/LOG:C:\Results.log"

InquiryProcess = Process.Start(CreateInquiryInfo)

InquiryProcess.WaitForExit(2000)
***

It seems like .NET 2.0 made this a much easier. But i've got some
restrictions here, so any help would be much appreciated. Also
permissions aren't the issue, i've already worked through that.

Jul 18 '06 #1
0 895

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

Similar topics

3
by: Jerry | last post by:
Hi All: Is there any way I can get my script to be able to create and CHMOD folders and files??? I always get the following error: mkdir(TESTDIR): Permission denied in /usr/www/users... Is...
10
by: Martin Ho | last post by:
I am running into one really big problem. I wrote a script in vb.net to make a copy of folders and subfolder to another destination: - in 'from.txt' I specify which folders to copy - in...
1
by: emilysmith10 | last post by:
I am creating a new database by copying a template .mdb file. This template has assigned permissions for each of it's objects. I know that just by copying the file, I lose these permissions. Is...
1
by: lecnac | last post by:
Here's some details: Server and workstation both in the same workgroup Logged into server as local Administrator Logged into workstation as a local user that is only in the Users group The...
1
by: lecnac | last post by:
Sorry for the repost. I must have done something wrong when I tried to post my reply (I can't seem to find it). Anyway, I'd really appreciate any help that anyone could provide. My issue is...
2
by: Jerad Rose | last post by:
I have a fairly simple C# console app which copies files from a network folder to a local folder. When the app resides on my local C: drive, it runs just fine. However, when the app resides on a...
2
by: Vayse | last post by:
Hi On the company server, there is a folder for each client. This folder should be named after the Clients 6 digiit ID. At the moment, the folders are created manually by users. Of course, this...
5
by: rogersw8n | last post by:
Some how, some way the account that creates folders under Temporary Internet files has been changed to a domain account for VS 2003 and VS 2005. I recently installed VS 2005. All seemed to be ok...
4
by: DudDav | last post by:
Hi All, I have been trying to configured WebDAV on our current IIS server as an alternative to FTP and have had some mixed success but I've hit a brick wall with one problem. The server...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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
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,...

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.