Copying Folders while maintaining permissions in ASP.NET 1.1

Discussion in 'ASP .Net' started by tsupchurch@gmail.com, Jul 18, 2006.

  1. Guest

    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.
    , Jul 18, 2006
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Codex Twin
    Replies:
    1
    Views:
    455
    Axel Dahmen
    Jan 8, 2005
  2. bona
    Replies:
    0
    Views:
    210
  3. Archie Call
    Replies:
    2
    Views:
    130
    Dave Burt
    Mar 22, 2006
  4. Replies:
    2
    Views:
    188
    Big and Blue
    Nov 2, 2006
  5. Replies:
    17
    Views:
    92
    Rustom Mody
    May 22, 2014
Loading...

Share This Page