I have a bat file CSCANPST.exe that will run automate the scanning of a pst file. This is not my creation so i cant take credit for it.
I know how to return the current user, so to make this process totally automatic how do I input the username into the correct "%username%" area in the following code?
One note the set PST_FILE from all my testing must all be inluded in one set of "" quotes or it will fail.
====This is the bat file to run=============
REM ***This batch file will automatically run SCANPST on every PST file in the
REM ***directory specified by PST_FILE_MASK.
set SCANPST_PATH="C:Program FilesMicrosoft OfficeOffice12SCANPST.EXE"
set PST_FILE_MASK="C:Documents and Settings" %username% & "Local SettingsApplication DataMicrosoftOutlook*.pst"
REM *** CD into in the directory that contains the launched bacth file...
for %%i in (%PST_FILE_MASK%) do (
REM Add an N to the end of the following line of you don't want backup files
cscanpst.exe %SCANPST_PATH% "%%i" N
f errorlevel 3 goto done
xp pro sp3, office 2007,server 2003 AD
June 11, 2010 1:52 PM
June 14, 2010 4:24 PM