Copying Folders while maintaining permissions in ASP.NET 1.1

T

tsupchurch

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.FullName,
file.Name), True)
Else
If
((System.IO.File.Exists(System.IO.Path.Combine(destDir.FullName,
file.Name))) = False) Then

file.CopyTo(System.IO.Path.Combine(destDir.FullName, 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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top