Jump to content
UBot Underground

How Do You Move Files With Random Names?


Recommended Posts

I have 2 CSV files that I need to move from the Download folder to the Desktop daily. The files have random names that will change daily. I didn't see it in the http://wiki.ubotstudio.com/wiki/Move_File documentation.

 

Example:

 

File 1     Vqyl6A20160823211456.csv

 

 

File 2     IqSDM820160823211450.csv

 

 

Cheers and all the best Ubot Community!

 

Jason

 

 

 

 

Link to post
Share on other sites

1. use get file command to list http://wiki.ubotstudio.com/wiki/Get_Files

2. create loop list

3. inside loop use move file command http://wiki.ubotstudio.com/wiki/Move_File

clear list(%OriginalFiles)
add list to list(%OriginalFiles,$get files($special folder("My Documents"),"Yes"),"Delete","Global")
set list position(%OriginalFiles,0)
loop($list total(%OriginalFiles)) {
    move file($next list item(%OriginalFiles),$special folder("Desktop"))
}
Link to post
Share on other sites

 

1. use get file command to list http://wiki.ubotstudio.com/wiki/Get_Files

2. create loop list

3. inside loop use move file command http://wiki.ubotstudio.com/wiki/Move_File

clear list(%OriginalFiles)
add list to list(%OriginalFiles,$get files($special folder("My Documents"),"Yes"),"Delete","Global")
set list position(%OriginalFiles,0)
loop($list total(%OriginalFiles)) {
    move file($next list item(%OriginalFiles),$special folder("Desktop"))
}

 

I can't use "Downloads" as my $special folder that's where the files get downloaded too. I think I understand the rest of the loop.

 

Thanks in advance!

Link to post
Share on other sites

I can't use "Downloads" as my $special folder that's where the files get downloaded too. I think I understand the rest of the loop.

 

Thanks in advance!

try

set(#DownloadFolder,$replace($special folder("Desktop"),"Desktop","Downloads"),"Global")

 

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...