Jump to content
Sign in to follow this  
Calistoga

FileMove Defined FileTypes

Recommended Posts

Calistoga

Hi,

I wasn't sure what to search for, but if this has been answered before, please point me to the right place.

Let's say that we have this variable:

$FileTypes = "EXE;CMD;BAT;JPG"

How can I make this;

FileMove(@DesktopDir & "\*.*", @MyDocumentsDir & "\Random\", 9)

move all filetypes listed in $FileTypes ?

Eg. *.exe, *.jpg etc.

Thanks in advance

Share this post


Link to post
Share on other sites
DaRam

Const $FileTypes = "EXE;CMD;BAT;JPG"
Dim $I, $J, $aFileTypes
$aFileTypes = StringSplit($FileTypes, ";")
$J = UBound($aFileTypes) -1
For $I = 1 to $J
      FileMove(@DesktopDir & "\*." & $aFileTypes[$I], @MyDocumentsDir & "\Random\", 9)
Next ;$I

Hi,

I wasn't sure what to search for, but if this has been answered before, please point me to the right place.

Let's say that we have this variable:

$FileTypes = "EXE;CMD;BAT;JPG"

How can I make this;

FileMove(@DesktopDir & "\*.*", @MyDocumentsDir & "\Random\", 9)

move all filetypes listed in $FileTypes ?

Eg. *.exe, *.jpg etc.

Thanks in advance

Share this post


Link to post
Share on other sites
weaponx

$FileTypes = "EXE;CMD;BAT;JPG"
$aFileTypes = StringSplit($FileTypes, ";")
For $X =1 to $aFileTypes[0]
FileMove(@DesktopDir & "\*." & $aFileTypes[$X], @MyDocumentsDir & "\Random\", 9)
Next

Share this post


Link to post
Share on other sites
DjDeep00

@DaRam & @Weaponx...you guys beat me to it...Good thing I refreshed before I posted the same response.

Share this post


Link to post
Share on other sites
Calistoga

Thank you guys, worked perfectly!

Share this post


Link to post
Share on other sites
DaRam

@DaRam & @Weaponx...you guys beat me to it...Good thing I refreshed before I posted the same response.

Been there, Done that :)

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  

×