Jump to content

FileFindFirstFile().. Am I doing this right?


Recommended Posts

The program is supposed to search for *.pst files, then copy the results to a server share.

What am I doing wrong? It doesn't seem to be doing anything.

$nMsg = GUIGetMsg()
Switch $nmsg
Case $bckuppst
While 1
$pst1=FileFindFirstFile("*.pst")
FileCopy($pst1, "\\majordc01\backups\" & @UserName, 8)
$pst2=FileFindNextFile($pst1)
FileCopy($pst2, "\\majordc01\backups\" & @UserName, 8)
if @error then ExitLoop
WEnd
EndSwitch

Thanks!

Link to comment
Share on other sites

  • Moderators

Are the .pst files all in one directory? If so, I would do something simple like this.

$dir1 = @DesktopDir & "Test"
$dir2 = @DesktopDir & "Test2"
FileCopy($dir1 & "*.pst", $dir2)

"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

Are the .pst files all in one directory? If so, I would do something simple like this.

$dir1 = @DesktopDir & "Test"
$dir2 = @DesktopDir & "Test2"
FileCopy($dir1 & "*.pst", $dir2)

No, I'm trying to search the computer, since some people tend to have pst files laying all over..
Link to comment
Share on other sites

I did basically copy the help file. Except the help file doesn't give the example I need. Is there some way for me to search recursively, dig deeper into directories? Not just the script directory.

Zedna, thanks for the answer. If you could tell me what I did wrong, would be appreciated.

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

×
×
  • Create New...