Jump to content
Sign in to follow this  

Use NTFS Encrypt / Decrypt with easy!

Recommended Posts


To see encrypted files in a different color check Explorer window -> Tools -> Folder Options -> View -> Show encrypted or compressed ntfs files in color.

$sFileName = 'C:\text.txt'

$a = DllCall('ADVAPI32','short',"EncryptFileA",'String',$sFilename)
If $a[0] <> 0 Then MsgBox(0,'','Check if the file is Encrypted!')
;$a[0] is 0 in case of problems   
$a = DllCall('ADVAPI32','short',"DecryptFileA",'String',$sFilename,'long',0)
If $a[0] <> 0 Then MsgBox(0,'','Now it should not be anymore.')

Of course it works only in W2k kernels in NTFS drives. If you can't know where your script will be executed.

Remember, the return value of the pos [0] will be a non zero if success a zero if unsuccess.

If applied to a existing folder it just set that NEW files will be encrypted. So you'll have to cript every file with loop. If needed check the Larry's (or the mine)_FileSearch func.

Edited by ezzetabi

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this