Ver Mensaje Individual
  #10 (permalink)  
Antiguo 25/03/2002, 18:14
vgaray
 
Fecha de Ingreso: octubre-2000
Ubicación: Juarez, Chih.
Mensajes: 161
Antigüedad: 24 años, 7 meses
Puntos: 0
Re: problema con CopyFile y ficheros solo lectura

Saludos.

Ruchu: El siguiente código te servirá para editar el atributo readonly de x archivos.

Tan solo edita una línea para especificar donde quieres que inicie la edicion y esta se hara recursivamente sobre los directorios hijos.

<%
Option Explicit
Response.Buffer = True
Dim Path
Path = server.mappath("./") 'ejemplo usando el directorio actual
Call Editar(Path) 'empieza la busqueda y edición
Session("counter") = 0
%>

<%
Function Editar(PathSpec)
Dim Fso, FolderInfo, Filelist, Archivo, File
Set Fso = CreateObject("Scripting.FileSystemObject&quot ;)
Set FolderInfo = Fso.GetFolder(PathSpec)
Set FileList = FolderInfo.Files

For Each File in FileList
Archivo = FormatURL(PathSpec) & "/" & UCase(Cstr(File.Name))
Session("Counter") = Session("Counter") + 1
Response.Write Session("Counter") & ".- " & Archivo & " " & Quitar_solo_lectura(Archivo) & "<br>"
Next
Dim f, fc, folder
Set f = Fso.GetFolder(PathSpec)
Set fc = f.SubFolders
For Each Folder in fc
Call Editar(PathSpec & "\" & Folder.Name)
Next
End Function
%>

<%
Function Quitar_solo_lectura(strFileName)
Dim objFSO, objFile
Set objFSO = Server.CreateObject("Scripting.FileSystemObje ct")
Set objFile = objFSO.GetFile(Server.MapPath(strFileName))
If objFile.Attributes AND 1 then
objFile.Attributes = objFile.Attributes - 1
Quitar_solo_lectura = " <b>Atributo editado.</b>"
End If
End Function
%>

<%
Function FormatURL(strPath)
Dim iPos
Dim str
iPos = InStr(1,strPath,"wwwroot",1)
str = Mid(strPath,iPos+7,Len(strPath))
FormatURL = Replace(str,"\","/")
End Function
%>



---------------------
Tan libre como gratuito!!!