wrote just a code to my friend who said he is a little busy.
some mumble:
if you need to move say outlook.pst or outlook.prf from local disk to secure backed up homedrive of user this is the code to use.
just place it in logonscript and it should rock just fine.
also remember that it has no error checking. (my scripts newer do)
I was already pointed to write this as UDF but it's not generic enough in my mind to qualify as UDF...
allthough it gives me some thought how to make sreg() simpler and perhaps even faster...
code:
;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"
;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)]
if 0=exist($replacePath+$filename) or $overwrite="yes"
copy $value $replacePath+$filename
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
all crap and comments are welcome