Sign in to follow this  
Followers 0
memnon

debugging DirCopy

4 posts in this topic

Hello,

i made a script what copies a directory from a server to a client.

DirCopy("d:\1234", "\\" & $element & "\c$\1234", 1) ...$element is the clientname...

well it seems, that copiing the dir is working fine, but if i check the @errorlevel i get an error back

if @error=1 then

$copy=" -> copy ok!"

Else

$copy=" -> copy failed"

endif

--> always get "copy failed" back

anyway to debug this failure ? cant get it out...

could it be that there are opened files are a problem and WHEN, how can i resolve my problem then ?


das beste Windows Support Forum: Windows 2000 Helpline und tschüss den WindowsfehlernProgrammieren: Autoit 3 - wer braucht noch VBS ?!Programmieren: Autoit 3 Forum?

Share this post


Link to post
Share on other sites



According to the help file, DirCopy doesn't set @error, it just gives a return value:

Return Value

Success: Returns 1.

Failure: Returns 0 if there is an error copying the directory.

So you want something like:

$DirCopied = DirCopy("d:\1234", "\\" & $element & "\c$\1234", 1)    ...$element is the clientname...

if $DirCopied =1 then 
    $copy=" -> copy ok!"
Else
    $copy=" -> copy failed"
endif

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

According to the help file, DirCopy doesn't set @error, it just gives a return value:

So you want something like:

$DirCopied = DirCopy("d:\1234", "\\" & $element & "\c$\1234", 1)    ...$element is the clientname...

if $DirCopied =1 then 
    $copy=" -> copy ok!"
Else
    $copy=" -> copy failed"
endif

thx, working

BTW.... is it in all function (also user declared functions !!) so, that positive =1 ?

Edited by memnon

das beste Windows Support Forum: Windows 2000 Helpline und tschüss den WindowsfehlernProgrammieren: Autoit 3 - wer braucht noch VBS ?!Programmieren: Autoit 3 Forum?

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

thx, working

BTW.... is it in all function (also user declared functions !!) so, that positive =1 ?

No, you'll need to read the UDF's you get off this site to see what they return and how.

If you're talking about regular built in functions, just read the help file to see what they return, may be a boolean such as 1 for true, maybe an array, so your best bet is to read first, use 2nd.

Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

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  
Followers 0