Find a PST File

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
dstrand
Newbie
Posts: 2
Joined: Wed May 23, 2012 3:25 am
Location: United States
Contact:

Find a PST File

Post by dstrand » Wed May 23, 2012 3:29 am

How can I find if a PST file (or multiple Pst) exists on the in the c: drive on computer. and send results of location and name of file, and e-mail results?
Danny

User avatar
JRL
Automation Wizard
Posts: 3532
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Wed May 23, 2012 5:26 am

Here's an example of one way to do it. See help for SMTPSendMail> for details on its usage. Script might take a few minutes depending on the speed of your computer and the size of the C:\ drive. Also the script does the same thing whether it finds a pst file or not. There is nothing built in to this to behave one way if files are found and another way if no files are found.

Code: Select all

Let>result_file=%temp_dir%dir_outcome.txt
IfFileExists>result_file
  DeleteFile>result_file
EndIf
Let>rp_wait=1
Let>rp_windowmode=0
RunProgram>cmd /c dir c:\*.pst /s /b /a-d > %result_file%

Let>SENDMAIL_STATUS=1
Let>subject=Outlook files discovered
Let>[email protected]
Let>myname=Mr Smith
Let>[email protected];[email protected]
Input>body,List of files found attached
SMTPSendMail>recipients,post.mail.com,me,myname,subject,body,result_file
Message>Result of SendMail: %SMTP_RESULT%

dstrand
Newbie
Posts: 2
Joined: Wed May 23, 2012 3:25 am
Location: United States
Contact:

Post by dstrand » Thu May 24, 2012 12:55 am

So far so good - how can I make the following file created by the script below
append the result file to a shared file? I want to run this on multiple computers. Also, as there a way to add the file size net to each PST found?

// COMPILE_OPTS|\\deploymentsrv\Installs\apps\PSTFind\pst_finder.exe||CONSOLE=0|INCLUDES=1| /HIDE
Let>result_file=%temp_dir%dir_outcome.txt
IfFileExists>result_file
DeleteFile>result_file
EndIf
Let>rp_wait=1
Let>rp_windowmode=0
RunProgram>cmd /c hostname >> %result_file%
RunProgram>cmd /c dir c:\*.pst /s /b /a-d > %result_file%
Danny

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts