Computing.Net > Forums > Programming > Batch file for Outlook

Batch file for Outlook

Reply to Message Icon

Original Message
Name: kandrews
Date: June 11, 2007 at 08:36:29 Pacific
Subject: Batch file for Outlook
OS: Windows XP
CPU/Ram: 1.6GHz/1GB
Model/Manufacturer: White Box
Comment:

I am looking to create a batch file that reports the size of an outlook .pst file. I desire to have a wild card that will look in the logged in user's directory under "Documents and Settings" and the default path to the outlook folder and pst file. I have a program that if you hard code the path it reports it as such: Total bytes: 201,147,392 (196,433.00 KB) (191.83 MB). Can I break up these fields and use them for an IF statement that displays an error if the file is over 1.5 GB

If extra info is needed I can provide the logic of it.

K. Andrews


Report Offensive Message For Removal


Response Number 1
Name: Razor2.3
Date: June 11, 2007 at 10:34:51 Pacific
Reply: (edit)

What is Outlook's "default path to the outlook folder and pst file?" And you might as well post what you have now.


Report Offensive Follow Up For Removal

Response Number 2
Name: kandrews
Date: June 11, 2007 at 12:35:23 Pacific
Reply: (edit)

In Windows 2000 Pro and XP the path is C:\Documents and Settings\username\Local Settings\Application Data\Microsoft\Outlook\Outlook.pst

The script I wish to make would be something like this (note sizeof is a program that returns a file's size):

sizeof *FilePath*
IF filesize > 1500 MB
(Display Warning message)
ELSE
(Exit)

Here is an example of the output of the sizeof program (typed out full path link on a vista system):

C:\Users\kandrews\Downloads>sizeof C:\Users\kandrews\AppData\Local\Microsoft\Out
look\Outlook.pst
Total bytes: 201,147,392 (196,433.00 KB) (191.83 MB)


K. Andrews


Report Offensive Follow Up For Removal

Response Number 3
Name: Razor2.3
Date: June 14, 2007 at 20:05:16 Pacific
Reply: (edit)

Wow, I leave for a few days, and no one posts this? The lot of you are slipping. Slipping, I say!

Well, if all you're going for is a warning message, it could be something like this batch file:

@for %%a in ("%userprofile%\AppData\Local\Microsoft\Outlook\*.*") do @IF /i %%~Za GEQ 1610612736 ECHO %a OVERSIZED

If you want to mimic the output, let me know. It can be done, but not easily with batch files. I'd recommend VBScript in that case.

If you want to mimic the output, that can be done too, but not easily with batch files. I'd recommend VBScript in that case.


Report Offensive Follow Up For Removal







Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: Batch file for Outlook

Comments:

 


  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 
Data Recovery Software




Have you ever used OpenOffice?

Yes, as my main suite.
Yes, occationally.
Yes, but only once.
No, never.


View Results

Poll Finishes In 5 Days.
Discuss in The Lounge