WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

File Version and Dir Mgmt

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

More Ways to Check and Set File Attributes

Keywords: 	 file attributes DllCall

FILE_ATTRIBUTE_READONLY    =1;       0x00000001  
FILE_ATTRIBUTE_HIDDEN      =2;       0x00000002  
FILE_ATTRIBUTE_SYSTEM      =4;       0x00000004  
FILE_ATTRIBUTE_DIRECTORY   =16;      0x00000010  
FILE_ATTRIBUTE_ARCHIVE     =32;      0x00000020  
FILE_ATTRIBUTE_NORMAL      =128;     0x00000080  
FILE_ATTRIBUTE_TEMPORARY   =256 ;    0x00000100  
FILE_ATTRIBUTE_COMPRESSED  =2048;    0x00000800  
FILE_ATTRIBUTE_OFFLINE     =4096;    0x00001000  

file="c:\autoexec.bat"
dll=strcat(dirWindows(1),"kernel32.dll")

attr=DllCall(dll,long:"GetFileAttributesA",lpstr:file)
Message("Debug",attr)

if attr & FILE_ATTRIBUTE_READONLY
   Message("FILE_ATTRIBUTE_READONLY","Set")
endif
if attr & FILE_ATTRIBUTE_HIDDEN
   Message("FILE_ATTRIBUTE_HIDDEN","Set")
endif
if attr & FILE_ATTRIBUTE_SYSTEM
   Message("FILE_ATTRIBUTE_SYSTEM","Set")
endif
if attr & FILE_ATTRIBUTE_DIRECTORY
   Message("FILE_ATTRIBUTE_DIRECTORY","Set")
endif
if attr & FILE_ATTRIBUTE_ARCHIVE
   Message("FILE_ATTRIBUTE_ARCHIVE","Set")
endif
if attr & FILE_ATTRIBUTE_NORMAL
   Message("FILE_ATTRIBUTE_NORMAL","Set")
endif
if attr & FILE_ATTRIBUTE_TEMPORARY
   Message("FILE_ATTRIBUTE_TEMPORARY","Set")
endif
if attr & FILE_ATTRIBUTE_COMPRESSED
   Message("FILE_ATTRIBUTE_COMPRESSED","Set")
endif
if attr & FILE_ATTRIBUTE_OFFLINE
   Message("FILE_ATTRIBUTE_OFFLINE","Set")
endif

Article ID:   W14727
Filename:   More Ways to Check and Set File Attributes.txt
File Created: 2000:11:15:13:33:12
Last Updated: 2000:11:15:13:33:12