Jump to content

DirCopy fails under WinPE if UNC path is used


 Share

Recommended Posts

The code below (compiled with V3.3) runs fine under WinXP, Vista and WinPE 2005. But not under WinPE 2.1 (i.e. Vista SP1 based WinPE). The DirCopy command fails. When I replace the UNC path with a drive letter, it works again.

As you can see from all the testing in the code, trivial explanations have been ruled out. The paths involved exist. Can't be permissions because it works with a drive letter. The UNC path is valid because by the time the DirCopy fails, several other dir & file functions have successfully used the same UNC path, including FileExists, FileGetAttrib and FileCopy.

Any idea what might be going on here? Or how to debug the situation? Or what I may need to add the WinPE? I've already tried filemon (hoping it would show a DLL not being found), but no luck...

Thanks for any thoughts...

CODE
$src = "\\core88a\provisioning\intelsata"

;$src = "z:\intelsata"

$dest = "c:\drivers"

If Not IsFolder($src) Then ErrorExit("Source folder not found: " & $src, 7)

DirCreate($dest)

If Not IsFolder($dest) Then ErrorExit("Unable to create target folder: " & $dest, 8)

If Not FileCopy($src & "\*.*", "c:\test1", 9) Then ; 8 = create dirs, 1 = overwrite

ErrorExit("FileCopy failed" , 9)

EndIf

If Not DirCopy($src, $dest, 1) Then ; 1 = overwrite

ErrorExit("DirCopy Failed", 10)

EndIf

Func ErrorExit($msg, $exitcode)

MsgBox(0x40010, "CopyTest", $msg, 10)

Exit $exitcode

EndFunc

; Return true if $s is a folder

Func IsFolder($s)

If Not FileExists($s) Or Not StringInStr(FileGetAttrib($s), "D") Then Return False

Return True

EndFunc

Link to comment
Share on other sites

  • 3 months later...
  • 5 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...