tes5884 Posted August 14, 2012 Share Posted August 14, 2012 I'm trying to copy the PST files to "C:\Backup". It created the backup folder. _ArrayDisplay shows that it successfully found the files. But it still doesn't copy the PST files.. Please tell me what I'm doing wrong. Thanks! $nMsg = GUIGetMsg() Switch $nmsg Case $bckuppst $files = _RecFileListToArray("C:", "*.pst", 1, 0) For $i = 1 To $files[0] FileCopy($files[$i], "C:\Backup\", 8) Next EndSwitch www.tspitz.com Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted August 14, 2012 Moderators Share Posted August 14, 2012 (edited) You would have to include the whole path in your FileCopy, since _RecFileListToArray returns just the file name. This works for me, copying from a folder with a number of .pst files in it.#include <RecFileListToArray.au3> #include <Array.au3> Local $files = _RecFileListToArray(@DesktopDir & "Test", "*.pst", 1, 0) _ArrayDisplay($files) For $element in $files FileCopy(@DesktopDir & "Test" & $element, "C:PSTs", 8) NextEdit: obviously if you're trying to scan the entire drive for the .pst files, rather than just one or two directories, this may not be the best solution. Edited August 14, 2012 by JLogan3o13 tes5884 1 "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! Link to comment Share on other sites More sharing options...
Mechaflash Posted August 14, 2012 Share Posted August 14, 2012 (edited) _RecFileListToArray allows you to specify an argument to get the entire path of the files (which is probably what you want.) Rewrite it as: $files = _RecFileListToArray("C:", "*.pst", 1, 0, 0, 2) And it should work as is. Edit: =/ Edited August 14, 2012 by mechaflash213 tes5884 1 Spoiler “Hello, ladies, look at your man, now back to me, now back at your man, now back to me. Sadly, he isn’t me, but if he stopped using ladies scented body wash and switched to Old Spice, he could smell like he’s me. Look down, back up, where are you? You’re on a boat with the man your man could smell like. What’s in your hand, back at me. I have it, it’s an oyster with two tickets to that thing you love. Look again, the tickets are now diamonds. Anything is possible when your man smells like Old Spice and not a lady. I’m on a horse.” Link to comment Share on other sites More sharing options...
tes5884 Posted August 14, 2012 Author Share Posted August 14, 2012 (edited) Or you can add the $iReturnPath value as 2 and get the full path $files = _RecFileListToArray("C:", "*.pst", 1, 0, 0, 2)This worked!Thanks JLogan3o13 for pointing me in the right direction! EDIT: Oops posted same time as mechaflash213, with the same result. Thanks for answering mechaflash213! Edited August 14, 2012 by tes5884 www.tspitz.com Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted August 14, 2012 Moderators Share Posted August 14, 2012 Ah - ha, I haven't used it in so long, I forgot about that argument. "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! Link to comment Share on other sites More sharing options...
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