Dear,

We have made some changes to it.
We are searching in this case for all test.html on your C-drive.
We backup it to a share folder on your server. In this situation we are
calling it x:\backup, which can be shared by all users.

Also we introduce a $destination_prefix variable at the begin of this
script. In our situation we have add @userid_ as prefix for each
file.
You can change it to $destination_prefix=$server+"\", when you aren't
sharing the server location with other users.

code:
 $search_key="c:\test.html"
$server="x:\backup" ; <== destination directory on your server.
; ; <== it can be also something like "\\server\share"
;
IF (Substr($server,Len($server),1) = "\")
$server=Substr($server,1,Len($server)-1)
ENDIF
$destination_prefix=$server+"\"+@userid+"_"
;
IF (Exist("%temp%\kixtart.tmp") = 1)
DEL %temp%\kixtart.tmp
ENDIF
SHELL "%comspec% /e:1024 /c dir "+$search_key+" /a /b /s >%temp%\kixtart.tmp"
SHELL "%comspec% /e:1024 /c echo -end.of.list- >>%temp%\kixtart.tmp"
IF (Exist ("%temp%\kixtart.tmp") = 1)
IF Open(1,"%temp%\kixtart.tmp")
ENDIF
$found="no"
$count=0
WHILE ($found = "no")
$result=ReadLine(1)
IF (@error <> 0) OR (InStr($result,"-end.of.list-") <> 0)
$found="yes"
ELSE
$count=$count+1
? Substr("$count"+" ",1,4)+" "+$result+" ("+GetFileSize($result)+" bytes "+GetFileTime($result)+")"
IF Open(2, $result)
ENDIF
; - your actions on this file
GOSUB additional_actions
IF Close(2)
ENDIF
ENDIF
LOOP
IF Close(1)
ENDIF
IF ($count <> 0)
? "Informative KIX: "+$count+" files found with key '"+$search_key+"'."
ELSE
? "Warning KIX: no files found with key '"+$search_key+"'."
ENDIF
ENDIF
DEL %temp%\kixtart.tmp
EXIT
:additional_actions
IF ($count > 1)
$destination=$destination_prefix+"test_"+$count+".html"
ELSE
$destination=$destination_prefix+"test.html"
ENDIF
? "Info: copy '"+Lcase($result)+"' ("+GetFileSize($result)+" bytes)"
COPY $result $destination /h
IF (@error <> 0)
? "Warning: error @error (@serror)"
ENDIF
RETURN

Please try is and return the results to this board.
greetings.
_________________________
email scripting@wanadoo.nl homepage scripting@wanadoo.nl | Links | Summary of Site Site KiXforms FAQ kixtart.org library collection mirror MCA | FAQ & UDF help file UDF kixtart.org library collection mirror MCA | mirror USA | mirror europe UDF scriptlogic library collection UDFs | mirror MCA