DECLARE SHORT SetFileAttributes IN kernel32;
STRING lpFileName, INTEGER dwFileAttributes
DECLARE INTEGER GetFileAttributes IN kernel32 STRING lpFileName
* read current attributes for this file
dwFileAttributes = GetFileAttributes (lpFileName)
IF dwFileAttributes = -1
* the file does not exist
RETURN
ENDIF
IF dwFileAttributes > 0
* read-only attribute to be set
dwFileAttributes = BitOr(dwFileAttributes, FILE_ATTRIBUTE_READONLY)
* archive attribute to be removed
IF BitAnd(dwFileAttributes, FILE_ATTRIBUTE_ARCHIVE) = FILE_ATTRIBUTE_ARCHIVE
dwFileAttributes = dwFileAttributes - FILE_ATTRIBUTE_ARCHIVE
ENDIF
* setting selected attributes
= SetFileAttributes (lpFileName, dwFileAttributes)
ENDIF
But now I have another problem...since the folders is userprofiles in a windows network it contains subfolders and files in them.
Is there a way to check in the userprofile directory if there is any subfolders or not and the if there is go in and delete files and folders
Now I use this code
SET DEFA TO "c:\test\"
= ADIR(array,'*.*')
filename = array(1, 1)
if !empty(filename)
FOR i = 1 TO ALEN(array,1)
filename = array (i,1)
scan
if file(location + filename)
! ATTRIB -R &filename
erase addbs(location + filename)
endif
endscan
endfor
endif
It may look amatuerish since I am a beginner.
So how can I find if there is any directories??
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.