La Web del Programador: Comunidad de Programadores
 
    Pregunta:  7022 - ATRIBUTOS DE LOS ARCHIVOS
Autor:  alejandro orihuela jurado
que tal soy alejandro, estudio ingenieria en computacion, mi pregunta es:

como puedo cambiar los atributos de un archivo en visual basic 5.0: lectura / escritura / oculto y modificar.

  Respuesta:  xavi
Hola Alejandro, para ello la propiedad Attributes. te adjunto el ejemplo de la ayuda.

Sub SetClearArchiveBit(filespec)
Dim fs, f, r
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.GetFile(fs.GetFileName(filespec))
If f.attributes and 32 Then
r = MsgBox("El bit Archivo está establecido, ¿desea borrarlo?", vbYesNo, "Establecer/Borrar bit Archivo ")
If r = vbYes Then
f.attributes = f.attributes - 32
MsgBox "El bit Archivo ha sido borrado."
Else
MsgBox "El bit Archivo permanece establecido."
End If
Else
r = MsgBox("El bit Archivo no está establecido. ¿Desea verlo?", vbYesNo, "Establecer/Borrar bit Archivo")
If r = vbYes Then
f.attributes = f.attributes + 32
MsgBox "El bit Archivo está establecido."
Else
MsgBox "El bit Archivo permanece borrado."
End If
End If
End Sub

Espero que te sirva.