Jump to content

File copy frrom temp dir (wildcard)


Recommended Posts

Well, first post. I am trying to copy a file from the temp dir, the folder that I am copying files from has its name changed every so often (the first part of the name stays the same).

Example

FileCopy(@TempDir & "\BUDL1******\iclog.rar", "N.Files\Getter\iclog.rar", 9)
I already know its the wildcards, would there be a way around this?
Link to comment
Share on other sites

Try this and look for the file under "C:\"

; Try this and look for the file under "C:\"
#include <Constants.au3>
Global $iConsole
Global $sOutput = ""
$iConsole = Run(@ComSpec & ' /c dir "' & @TempDir & '\BUDL1*" /b /ad', _
        "", @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD)
While 1
    $sOutput &= StdoutRead($iConsole)
    If @error Then ExitLoop
Wend
$sOutput = StringStripWS(StringStripCR($sOutput), 3)
FileCopy(@TempDir & "\" & $sOutput & "\iclog.rar", "C:\iclog.rar", 1)

Here, we run a console command: "DIR", using the mimimalist /B switch and an attribute switch: "/AD", retrieving the output of the command: the name of an existing folder.

Edited by UberNuss

Das Häschen benutzt Radar.

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