Hmmm strange. I could be wrong, my suspicions lead me to think maybe you're doing a RedirectOutput somewhere, and these are actually return codes that are being logged??

What happens if you put $nul= in front of all your log lines? This will suppress the return codes by assigning to them to the $nul variable. Also helps eliminate the creation of a console window.

Couple other things...Make sure when you OPEN your log file to use a 5, this is the option to create a new file & the write access option added together. And this line looks a little redundant...I'm not sure anything is being accomplished by splitting a filename with '.pst', only to rejoin it with '.pst'.

$NewPSTName = @USERID+'_'+Join(Split(Join(Split($PSTName,' '),'_'),'.pst'),'.pst')

Are there any other problems notices when you run it? Are the files being successfully moved, just not logged?

$nul = Open (1,$Log,5)
$nul = Writeline (1,$NewPSTName + @CRLF)
$nul = Close (1)


Edited by ShaneEP (2011-07-12 11:53 PM)