Jump to content

Recommended Posts

Posted (edited)

You can make a program or solution that copies all files of a certain extension, example  > .rar (only rar),  and copies them to a directory

 

 

too simple I solved ðŸ™‚

Likethat.JPG

how it should look.JPG

Edited by AlMax3000
Posted
  On 12/1/2019 at 7:09 PM, AlMax3000 said:

You can make a program or solution that copies all files of a certain extension, example  > .rar (only rar),  and copies them to a directory

Expand  

FileCopy (see example in the help)

Musashi-C64.png

"In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move."

Posted (edited)
  On 12/1/2019 at 7:45 PM, Musashi said:

FileCopy (see example in the help)

Expand  

yes bro... I had solved just with the example you posted, but I should create an array for the extension, otherwise I would have to copy the whole string whenever

Edited by AlMax3000
Posted (edited)
  On 12/1/2019 at 7:49 PM, AlMax3000 said:

but I should create an array for the extension, otherwise I would have to copy the whole string whenever

Expand  

FileCopy accepts Wildcards e.g. *.rar

Maybe you mean something like this ðŸ¤” :

#include <FileConstants.au3>
#include <WinAPIShPath.au3>

Opt('MustDeclareVars', 1)

Global $sSourceDir, $sDestDir, $iCopyResult
Global $aExtensions[4] = ["*.jpg", "*.gif", "*.avi ", "*.rar"]
$sSourceDir = _WinAPI_PathAddBackslash(@ScriptDir & "\TestCopySource")
$sDestDir   = _WinAPI_PathAddBackslash(@ScriptDir & "\TestCopyDest")

For $i = 0 To UBound($aExtensions) - 1
    ConsoleWrite("+ Copy Extension = " & $aExtensions[$i] & @CRLF)
    $iCopyResult = FileCopy($sSourceDir & $aExtensions[$i], $sDestDir, $FC_OVERWRITE + $FC_CREATEPATH)
    ConsoleWrite("> Result = " & $iCopyResult & "  (1 = ok , 0 = not ok/no files)" & @CRLF)
Next

By the way: what is the purpose of the game graphic?

Edited by Musashi

Musashi-C64.png

"In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move."

Posted
  On 12/1/2019 at 8:29 PM, Musashi said:

FileCopy accepts Wildcards e.g. *.rar

Maybe you mean something like this ðŸ¤” :

#include <FileConstants.au3>
#include <WinAPIShPath.au3>

Opt('MustDeclareVars', 1)

Global $sSourceDir, $sDestDir, $iCopyResult
Global $aExtensions[4] = ["*.jpg", "*.gif", "*.avi ", "*.rar"]
$sSourceDir = _WinAPI_PathAddBackslash(@ScriptDir & "\TestCopySource")
$sDestDir   = _WinAPI_PathAddBackslash(@ScriptDir & "\TestCopyDest")

For $i = 0 To UBound($aExtensions) - 1
    ConsoleWrite("+ Copy Extension = " & $aExtensions[$i] & @CRLF)
    $iCopyResult = FileCopy($sSourceDir & $aExtensions[$i], $sDestDir, $FC_OVERWRITE + $FC_CREATEPATH)
    ConsoleWrite("> Result = " & $iCopyResult & "  (1 = ok , 0 = not ok/no files)" & @CRLF)
Next

By the way: what is the purpose of the game graphic?

Expand  

yes

  • Moderators
Posted

AlMax3000,

As the graphics also appear in this thread , we will assume there is a link and lock this one too. Please read the Forum rules before you post again.

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

  Reveal hidden contents

 

  • Moderators
Posted (edited)
  On 12/1/2019 at 8:29 PM, Musashi said:

By the way: what is the purpose of the game graphic?

Expand  

Why would you help and then ask why they're breaking the rules? 

@AlMax3000 You appear not to have read our forum rules, especially the section on game automation. Please read them now

Edit: Too slow :)

Edited by JLogan3o13

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Guest
This topic is now closed to further replies.
×
×
  • Create New...