CSCANPST To Automate Running SCANPST.EXE

Status
Not open for further replies.

srmsrm

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
IMAP
I'm looking for help on a program call CSCANPST.EXE (http://josh.com/cscanpst) that I use to automate using SCANPST.EXE. I was hoping maybe others had used it and can provide some feedback. I also tried cmdscan.exe (http://www.opindian.com/blog/2008/09/02/automating-outlooks-inbox-repair-tool-scanpst/) but it does not seem to work on larger PST files (mine is about 10.5 GB).



I am using W7 64 Bit with the scheduler. I have so the task runs when I’m logged in (which is usually always – even at night). The script runs, however, it seem the path (field) to the PST file is not populated until I click on the SCANPST dialog. If I run the batch file directly, it seems to work fine.
Below is my script that I have configured to run CSCANPST.EXE multiple times if there is error 1 or 2. Errors 1 or 2 reflect file needs repaired and he script reruns.
Any suggestions? I know its not specifically an Outlook issue, however, thought I would try.
=============================================
REM Stop the Win Mobile sync application

nircmdc killprocess wcescomm.exe
REM Gracefully close Outlook so that the repair scan can run

nircmdc closeprocess outlook.exe
REM Wait for outlook to close and clean up
nircmdc waitprocess outlook.exe
REM Delete scan log
Del cscanpst.log
REM Scan PST file and add an N to the end to remove backup files
REM Based on error, either finishes or rescans.
cscanpst.exe "C:\Program Files (x86)\Microsoft Office\Office14\SCANPST.EXE" "C:\SRMDATAPST\Work.PST" N
if %errorlevel% == 0 GOTO FINISH
if %errorlevel% == 1 GOTO RESCAN1
if %errorlevel% == 2 GOTO RESCAN1
if %errorlevel% == 3 GOTO FINISH
if %errorlevel% == 4 GOTO FINISH
if %errorlevel% == 5 GOTO FINISH
if %errorlevel% == 6 GOTO FINISH
if %errorlevel% == 7 GOTO FINISH
if %errorlevel% == 8 GOTO FINISH
if %errorlevel% == 9 GOTO FINISH
if %errorlevel% == 10 GOTO FINISH
if %errorlevel% == 11 GOTO FINISH
if %errorlevel% == 12 GOTO FINISH
if %errorlevel% == 13 GOTO FINISH
:RESCAN1
REM Scan PST file and add an N to the end to remove backup files
REM Based on error, either finishes or rescans.
cscanpst.exe "C:\Program Files (x86)\Microsoft Office\Office14\SCANPST.EXE" "C:\SRMDATAPST\Work.PST" N
if %errorlevel% == 0 GOTO FINISH
if %errorlevel% == 1 GOTO RESCAN1
if %errorlevel% == 2 GOTO RESCAN1
if %errorlevel% == 3 GOTO FINISH
if %errorlevel% == 4 GOTO FINISH
if %errorlevel% == 5 GOTO FINISH
if %errorlevel% == 6 GOTO FINISH
if %errorlevel% == 7 GOTO FINISH
if %errorlevel% == 8 GOTO FINISH
if %errorlevel% == 9 GOTO FINISH
if %errorlevel% == 10 GOTO FINISH
if %errorlevel% == 11 GOTO FINISH
if %errorlevel% == 12 GOTO FINISH
if %errorlevel% == 13 GOTO FINISH
:FINISH



=============================================

Thanks.

Shawn

 

srmsrm

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
IMAP
Thanks to those who reviewed my thread. I think I got it resolved so I can automate running SCANPST.EXE. I used more of the vendor's code.

set SCANPST_PATH="C:\Program Files (x86)\Microsoft Office\Office14\SCANPST.EXE"

set PST_FILE_MASK="C:\SRMDATAPST\*.pst"

nircmdc killprocess wcescomm.exe

nircmdc closeprocess outlook.exe

nircmdc waitprocess outlook.exe

Del cscanpst.log

for %%i in (%PST_FILE_MASK%) do (cscanpst.exe %SCANPST_PATH% "%%i" N)

if %errorlevel% == 0 GOTO FINISH

if %errorlevel% == 1 GOTO RESCAN1

if %errorlevel% == 2 GOTO RESCAN1

if %errorlevel% == 3 GOTO FINISH

if %errorlevel% == 4 GOTO FINISH

if %errorlevel% == 5 GOTO FINISH

if %errorlevel% == 6 GOTO FINISH

if %errorlevel% == 7 GOTO FINISH

if %errorlevel% == 8 GOTO FINISH

if %errorlevel% == 9 GOTO FINISH

if %errorlevel% == 10 GOTO FINISH

if %errorlevel% == 11 GOTO FINISH

if %errorlevel% == 12 GOTO FINISH

if %errorlevel% == 13 GOTO FINISH

:RESCAN1

for %%i in (%PST_FILE_MASK%) do (cscanpst.exe %SCANPST_PATH% "%%i" N)

if %errorlevel% == 0 GOTO FINISH

if %errorlevel% == 1 GOTO RESCAN1

if %errorlevel% == 2 GOTO RESCAN1

if %errorlevel% == 3 GOTO FINISH

if %errorlevel% == 4 GOTO FINISH

if %errorlevel% == 5 GOTO FINISH

if %errorlevel% == 6 GOTO FINISH

if %errorlevel% == 7 GOTO FINISH

if %errorlevel% == 8 GOTO FINISH

if %errorlevel% == 9 GOTO FINISH

if %errorlevel% == 10 GOTO FINISH

if %errorlevel% == 11 GOTO FINISH

if %errorlevel% == 12 GOTO FINISH

if %errorlevel% == 13 GOTO FINISH

:FINISH
 
Status
Not open for further replies.
Thread starter Similar threads Forum Replies Date
M Outlook macro to automate search and forward process Outlook VBA and Custom Forms 6
S automate save the .xlxs file to share Network Using Outlook 1
P Automate Outlook Start - No Active Explorer Object Found Using Outlook 10
C Further automate several tasks with rule, VBA or Quick Step Using Outlook 1
K Automate permamnent delete after x days with exceptions Using Outlook 1
O automate dates in outlook template Using Outlook 1
T Automate Outlook 2010 Using Outlook 4
S How to automate showing the Public Folder Calender to Mail Favorite folder Using Outlook 0
J OL2003 Macro disables itself - looking for way to automate 'enable' Using Outlook 2
2 automate login to outlook we app Exchange Server Administration 3
S Automate Senders email to go in Specified Folders Using Outlook 2
S Automate saving of attachments on new incoming emails Outlook VBA and Custom Forms 3
B automate email message on Outlook Calendar notification alerts? Outlook VBA and Custom Forms 1
S automate outlook stationary Outlook VBA and Custom Forms 1
Q Automate Outlook profiles for imaging Using Outlook 2
Q Automate BCM backup? BCM (Business Contact Manager) 1
N contact notepad 'style' getting changed after clicking and running Activities Using Outlook 2
Bri the Tech Guy Run Script rule not running for newly arriving messages Outlook VBA and Custom Forms 25
S Problem running Command button code Outlook VBA and Custom Forms 2
B Automation error running VB macro code Outlook VBA and Custom Forms 8
Diane Poremsky OUTLOOK.EXE continues running after you exit Outlook New Slipstick.com Articles 0
Diane Poremsky Running Outlook Macros on a Schedule New Slipstick.com Articles 0
B ActiveExplorer return NULL on new Window user login and running Outlook first time Using Outlook 1
JorgeDario Template oft that contains VBScript Is not running Using Outlook 1
M Mark Complete keyboard shortcut... on a mac running Windows Bootcamp Using Outlook 0
N Outlook 2007 To-Do-List status keeps running Using Outlook 2
S The attempted operation failed ... 2nd time running code Outlook VBA and Custom Forms 3
G email returns after running macro to move emails Outlook VBA and Custom Forms 1
P Outlook Macro keeps running for the same messagage Using Outlook 2
N Running multiple macros upon sending Outlook VBA and Custom Forms 6
M Accessing BCM with Excel / Running Reports BCM (Business Contact Manager) 1
G Error when running scanpst.exe Using Outlook 1
V Running scripts with Outlook 2013 Using Outlook 17
D Stopping "do you want to continue running scripts on this page" warnings Using Outlook 4
M Running macros in tasks sent out as meeting requests in invitees machine Using Outlook 4
N Rules stop running automatically Using Outlook 10
D VBA code running on Server? Shared mailbox email routing Using Outlook 3
T WAB editing: To help prevent malicious code from running.......... Using Outlook 18
M Outlook.exe 1.2Gb memory usage if running certain BCM reports BCM (Business Contact Manager) 8
M Why rules stop running automatically? Using Outlook 1
V Trouble Running Outlook 2007 and 2010 Using Outlook 4
L remove a hotmail account from Outlook 2007 running on Vista home premium Using Outlook.com accounts in Outlook 1
S Outlook 2007 Running on Windows 7 hangs on send Using Outlook 7
P I have Outlook 2007 on a two year old computer running Vista. How do I copy my Outlook Contacts list and move them over to Outlook 2010 on a brand new Using Outlook 1
D Opening files in Mail Folders takes 15 seconds - running slow ? Using Outlook 4
D User running outlook 2003 not able to connect to Exchange server 2007 Using Outlook 5
P 2 Member DAG - Members Virtualised running on non Clustered Hosts - supported Configuration? Exchange Server Administration 2
G Running multiple sessions of Outlook Using Outlook 2
M Business Contact Manager 2010 - Running With Custom Mail Profile Using Outlook 2
B Outlook 2010 CAN'T Connect to 2 Different Exchange Servers running Exchange 2010?!?!?!?!?!?! Using Outlook 1
Similar threads


















































Top