Jump to content

Not exporting array properly


Recommended Posts

Ok

If i was using CMD i would have the files to exclude like this (shortened example)

SET _exc_vista_files="Maid with the Flaxen Hair.mp3" "Sleep Away.mp3" "Chrysanthemum.jpg" "Desert.jpg" "Hydrangeas.jpg"

And Robocopy reads it like this

Maid with the Flaxen Hair.mp3

Sleep Away.mp3

Chrysanthemum.jpg

Desert.jpg

Hydrangeas.jpg

In AutoiT ihave done this (Shortened Example)

$sExcVistaFiles = "Chrysanthemum.jpg|Desert.jpg|Despertar.wma|Din Din Wo (Little Child).wma|Distance.wma|Maid with the Flaxen Hair.mp3"
$aExcVistaFiles = StringSplit($sExcVistaFiles, "|", 2)

Each way i try it it seperates the elements like Din Din Wo (Little Child).wma and they become

Din

Din

Wo

(Little Child).wma

I cant seem to find a way to feed it to robocopy in the correct format

Ive tried with it as a string and array and using arraytostring converting back

Im probably missing something simple so a little help please

Edited by Chimaera
Link to comment
Share on other sites

Maybe you should use quotation marks for the /XF parameter.

$sExcVistaFiles = 'Chrysanthemum.jpg|Desert.jpg|Despertar.wma|Din Din Wo (Little Child).wma|Distance.wma|Maid with the Flaxen Hair.mp3'
$sExcVistaFiles = '"' & StringReplace($sExcVistaFiles, "|", '"|"') & '"'
$aExcVistaFiles = StringSplit($sExcVistaFiles, "|", 2)

Br,

UEZ

Edited by UEZ

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Link to comment
Share on other sites

Thanks for that

I ended up having to do this after it to get it to work

$test = _ArrayToString($aExcVistaFiles, " ")

and then passing $test to /XF

then it appears in robocopy as "item" "next item" etc

Also within the excludes are things like this

OAM's Blues.wma

Which breaks the quotes how do i allow for that? Edited by Chimaera
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...