CopyTo Scrips error

Things you’d like to miss in the future...
Forum rules
:warnred20: :warnred20: :warnred20: :warnred20: :warnred20: READ THIS AND DO IT!!! :warnred20: :warnred20: :warnred20: :warnred20: :warnred20:

:info: Please include the following information:
1) Your XYplorer Version (e.g., v28.00.0801)
2) Your Windows Version (e.g., Win 11)
3) Your Screen Scaling Percentage (e.g., 125%).

:info: We strongly recommend adding your Windows Version and Screen Scaling Percentage to the Location field in your Profile or to your Signature. That way, you only have to type them once, and we won't have to search for that vital information.

:info: When attaching an Image, please use the Attachment tab at the bottom of your post and click "Add files".

:warnred20: :warnred20: :warnred20: :warnred20: :warnred20: READ THIS AND DO IT!!! :warnred20: :warnred20: :warnred20: :warnred20: :warnred20:
Post Reply
KeesButh
Posts: 15
Joined: 06 Sep 2023 14:26

CopyTo Scrips error

Post 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.
To see the attached files, you need to log into the forum.

highend
Posts: 14991
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: CopyTo Scrips error

Post by highend »

You've set 1 for

Code: Select all

[rootpath]
^^

copyto "\\192.168.252.108\c$\ETL", "u:\Secu\Exact\Leeg\Klanten\*.*", 5:=2
would work for example...
One of my scripts helped you out? Please donate via Paypal

KeesButh
Posts: 15
Joined: 06 Sep 2023 14:26

Re: CopyTo Scrips error

Post 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?

highend
Posts: 14991
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: CopyTo Scrips error

Post by highend »

Read my post again...
One of my scripts helped you out? Please donate via Paypal

KeesButh
Posts: 15
Joined: 06 Sep 2023 14:26

Re: CopyTo Scrips error

Post by KeesButh »

Thanks that works, but can you explain?

highend
Posts: 14991
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: CopyTo Scrips error

Post 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
One of my scripts helped you out? Please donate via Paypal

KeesButh
Posts: 15
Joined: 06 Sep 2023 14:26

Re: CopyTo Scrips error

Post by KeesButh »

Thanks for the explanation!

Post Reply