Page 1 of 1
CopyTo Scrips error
Posted: 06 Sep 2023 14:45
by KeesButh
I want to create a simple script to copy a number of files, After some experiementing I created this script (in Try Script):
copyto "\\192.168.252.108\c$\ETL", "u:\Secu\Exact\Leeg\Klanten\*.*"
Asks Replace or skip (as expected). If I select replace all works.
I wanted to get rid of the prompt so I added
copyto "\\192.168.252.108\c$\ETL", "u:\Secu\Exact\Leeg\Klanten\*.*", 1
Now I get the attached error.
Re: CopyTo Scrips error
Posted: 06 Sep 2023 15:12
by highend
You've set 1 for
^^
copyto "\\192.168.252.108\c$\ETL", "u:\Secu\Exact\Leeg\Klanten\*.*", 5:=2
would work for example...
Re: CopyTo Scrips error
Posted: 06 Sep 2023 15:41
by KeesButh
I tried these three lines:
copyto "\\192.168.253.108\c$\ETL", "u:\Secu\Exact\Leeg\Klanten\*.*"
//copyto "\\192.168.253.108\c$\ETL", "u:\Secus\Exact\Leeg\Klanten\*.*", 1
//copyto "\\192.168.253.108\c$\ETL", "u:\Secu\Exact\Leeg\Klanten\*.*", "u:\Secu\Exact\Leeg\Klanten"
One works with prompt
Two and three both fail with the same error
Could it be the command length?
Re: CopyTo Scrips error
Posted: 06 Sep 2023 15:47
by highend
Read my post again...
Re: CopyTo Scrips error
Posted: 06 Sep 2023 15:54
by KeesButh
Thanks that works, but can you explain?
Re: CopyTo Scrips error
Posted: 06 Sep 2023 16:02
by highend
It's setting the 6th parameter to 2 (= Overwrite). Because the syntax counts from 0 and not from 1 it's 5:=2
Re: CopyTo Scrips error
Posted: 06 Sep 2023 16:08
by KeesButh
Thanks for the explanation!