Seems to have some problems....I'm getting an 'expected expression' error on the line directly following the move file line. Here is a snippet of my code:

Code:

$Dir = dirplus($Directory, "/s /m .shtm")
For each $Element in $Dir
If GetFileAttr($element) & 16
;do nothing - the element is a folder
Else
If Right($element.name,5) = ".shtm"
$ShtmFileName = $Element.name

;Rename it to filename.shtm.tmp if it doesn't exist
$TmpFileName = $Element.name + ".tmp"
If not exist($TmpFileName)
$Element.MoveFile($shtmFileName, $TmpFileName)
?"Renaming error: " + @error