no, I still don't like the idea of UDF...
anyway, you can work on it.
I just made the file-copy an option and also colorized my code [Wink]



;what files to move:
$fileExtension="pst"
;specify what should be the new location:
$replacePath="u:\Exchange\"
;if file exist in new location should it be overwritten:
$overwrite = "yes"
;remove old or keep:
$remove="yes"
;copy file or just change regs if file already exists:
$copyFile="yes"

;don't change anything below this
$Profilesroot="HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles\"
$Profile=-1
do
 if len($basekey)
  $keyIndex=-1
  do
   if len($subkey)
    $valueIndex=-1
    do
     if "."+$fileExtension=right($value,4)
      if exist($value)
       $filename=split($value,"\"
       $filename=$filename[ubound($filename)]
       $exFlag=exist($replacePath+$filename)
       if $exFlag or $copyFile="yes"
        if ($exFlag and $overwrite="yes") or ($copyFile="yes" and $exFlag=0)
          del $replacePath+$filename
          copy $value $replacePath+$filename
        endif
        if $remove="yes"
         del $value
        endif
        $nul=writevalue($Profilesroot+$basekey+"\"+$subkey,$valuename,$replacePath+$filename,"REG_SZ")
       endif
      endif
     endif
     $valueIndex=$valueIndex+1
     $valuename=enumvalue($Profilesroot+$basekey+"\"+$subkey,$valueIndex)
     $value=readvalue($Profilesroot+$basekey+"\"+$subkey,$valuename)
    until $value=259 or @error
   endif
   $keyIndex=$keyIndex+1
   $subkey=enumkey($Profilesroot+$basekey,$keyIndex)
  until $subkey=259 or @error
 endif
 $Profile=$Profile+1
 $basekey=enumkey($Profilesroot,$Profile)
until $basekey=259 or @error

_________________________
!

download KiXnet