Jump to content

FileMove Defined FileTypes


Recommended Posts

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

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...