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

DllCall Information

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

How to Get Encrypted Attribute from a Directory


Question:

I'm using Windows XP and want to check if a directory has the EFS Encrypted attribute. My idea to use the command 'DirAttrGet' did not work. This command does not reconize this attribute. Has anyone got a brilliant idea ??

Answer:

Sorry no built-in function in Winbatch to retrieve that.

Although, here is some sample code that might work:

dirname = "c:\somedir"
attr = DllCall(StrCat(DirWindows(1), "kernel32.dll"), long:"GetFileAttributesA", lpstr:dirname) encr = attr & 16384
If encr Then Message(dirname, "Encrypted")
Else Message(dirname, "Not encrypted")

Article ID:   W15930
File Created: 2004:03:30:15:41:44
Last Updated: 2004:03:30:15:41:44