Visual Basic - RE: %temp% en vbs como lo sustituyo????

Life is soft - evento anual de software empresarial
 
Vista:
Imágen de perfil de A.H.H

RE: %temp% en vbs como lo sustituyo????

Publicado por A.H.H (116 intervenciones) el 16/11/2010 22:40:39
El siguiente ejemplo borra carpetas y archivos dentro de temp
aunque tengan el atributo de SOLO LECTURA activado Y SI HAY ERROR
SIGUE:

Const DeleteReadOnly = True
Set WshShell = CreateObject("WScript.Shell")
Set objEnv = WshShell.Environment("Process")
Set variable = CreateObject("Scripting.FileSystemObject")
RUTA = objEnv("Temp") & "\*.*"
on error resume next
variable.DeleteFile RUTA, DeleteReadOnly
variable.DeleteFolder RUTA, DeleteReadOnly
MsgBox "ARCHIVOS y CARPETAS BORRADOS DE TEMP"
WScript.quit

salu2
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder