thexshadow Posted February 26, 2010 Posted February 26, 2010 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).ExampleFileCopy(@TempDir & "\BUDL1******\iclog.rar", "N.Files\Getter\iclog.rar", 9)I already know its the wildcards, would there be a way around this?
UberNuss Posted February 26, 2010 Posted February 26, 2010 (edited) 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 February 26, 2010 by UberNuss Das Häschen benutzt Radar.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now