Jump to content
Sign in to follow this  

DirCopy fails under WinPE if UNC path is used

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...

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

;$src = "z:\intelsata"

$dest = "c:\drivers"

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


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)


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

ErrorExit("DirCopy Failed", 10)


Func ErrorExit($msg, $exitcode)

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

Exit $exitcode


; 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


Share this post

Link to post
Share on other sites

Anyone having any luck with this? Having the same issue here.

Share this post

Link to post
Share on other sites

same issue here so i just use xcopy :)

RunWait('xcopy' & " /E /S /Y " & $var3 & " " & $var4 & " ", "x:\", @SW_SHOW)
Edited by lxxl

Share this post

Link to post
Share on other sites

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
Sign in to follow this