Page 1 of 1 1
Topic Options
#42938 - 2003-07-16 05:56 PM Why this Function doesn´t work?
hynreck Offline
Lurker

Registered: 2003-07-16
Posts: 3
sorry my poor english..

This function check the size of the .pst file of outlook

$perfilusr = windows 2000 %userprofile% variable

Function CompruebaPST()

$CompPSTRadioButton.Value=1

DBGMessage ("Info", "Comprobando PST de outlook:" )
Progress( "Comprobando PST")

$PSTPATH = "$perfilusr\Config~1\Datosd~1\Microsoft\Outlook\"


If Exist ($pstpath+"outlook.pst")

DBGMessage ("Info"," - PST Encontrado")

$pstsize = GetFileSize($PSTPATH + "outlook.pst")

$pstsize = $pstsize / (1024*1024)

DBGMessage ("Info"," - Tamaño del PST " + $pstsize + " Mb ")

Else

DBGMessage ("Error"," PST No reside en la carpeta por defecto")

EndIf

is something related to the path i think.. "if exist" find the file but getfilesize dont work, the variable $pstsize remains empty if i try to check the file size of a file in "c:\" for example.. works perfectly.. and no, the outlook.pst is´t is bigger than 2 gb

[ 16. July 2003, 18:00: Message edited by: hynreck ]

Top
#42939 - 2003-07-16 06:03 PM Re: Why this Function doesn´t work?
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Use DEBUG ON to step through your code. Also, please rad up on variable scoping and use SETOPTION('Explicit','on') to prevent problems with variable scoping.

Also, take a look at the content of $PSTPATH and don't use variables inside strings, it's a bad practice.
_________________________
There are two types of vessels, submarines and targets.

Top
#42940 - 2003-07-16 06:31 PM Re: Why this Function doesn´t work?
hynreck Offline
Lurker

Registered: 2003-07-16
Posts: 3
$PSTPATH is ok, EXIST find the outlook.pst file.. the problem appears to be in the path:

$PSTPATH = $perfilusr + "\Config~1\Datosd~1\Microsoft\Outlook\"

if i reemplaze this with:

$PSTPATH = $perfilusr

And put a "outlook.pst" file in this dir, the script run OK

maybe some limitation of "getfilesize()" and the 8.3 format in directory name? :/

Top
#42941 - 2003-07-16 06:39 PM Re: Why this Function doesn´t work?
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
What does
code:
$pstsize = GetFileSize($PSTPATH + "outlook.pst")
? 'Error '+@ERROR+' - '+@SERROR
get $a

show as error code?

You might also want to use the correct long foldernames.
_________________________
There are two types of vessels, submarines and targets.

Top
#42942 - 2003-07-16 06:51 PM Re: Why this Function doesn´t work?
hynreck Offline
Lurker

Registered: 2003-07-16
Posts: 3
yeah sorry sorry and thanks man.. i´m really dumb.. the error is....

The file is in use by other process!! [Big Grin] (MS Outlook)

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
1 registered (Allen) and 641 anonymous users online.
Newest Members
batdk82, StuTheCoder, M_Moore, BeeEm, min_seow
17885 Registered Users

Generated in 0.055 seconds in which 0.025 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org