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
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