Find a PST File
Moderators: JRL, Dorian (MJT support)
Find a PST File
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
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%
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%
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