Jump to content
Sign in to follow this  

Trying to copy a folder using UNC Path

Recommended Posts


I can't seem to copy a folder properly. I am likely using the wrong path syntax. This is a test app.

$FolderPath = @UserProfileDir & "\Desktop\Chipset Drivers\*.*"
FileCopy ( "\\server\folder\folder\*.*", $FolderPath )
Run("Explorer.exe " & @UserProfileDir & "\Desktop\Chipset Drivers")
MsgBox(4096,"Variable test",$FolderPath)

The variable comes up with the right information, but it isn't copying the folder and all of its contents. It doesn't matter what path I put in there either. When the Explorer part runs, it says it can't find the folder, but even Beta Run does not show me any errors.

Share this post

Link to post
Share on other sites


from help:

; Method to copy a folder (with its contents)


FileCopy("C:\old\*.*", "C:\new\")

You neendn't the *.* when copying content.

so long,


Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Share this post

Link to post
Share on other sites

Be sure the target path exists (@UserProfileDir & "\Desktop\Chipset Drivers) or add to FileCopy flag 8 to create destination folder.

FileCopy ( "\\server\folder\folder\*.*", $FolderPath, 8)

AutoIt Scripts:NetPrinter - Network Printer UtilityRobocopyGUI - GUI interface for M$ robocopy command line

Share this post

Link to post
Share on other sites

Yes this allowed my test to work. I won't be able to test it using real code until the next No-OS build comes through.

The actual code (which I removed) copies a folder over and runs a program, then deletes the folder afterwards. That may present problems in the future but we shall see.

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  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.