GordonShumway Posted February 27, 2014 Share Posted February 27, 2014 (edited) I've got my first Windows (8.1 Pro) with EFS support. I started using EFS and noticed that some of the FileCopy commands in my AutoIt scripts were no longer functioning properly. If I FileCopy a "normal" (=no EFS) file, the FileCopy returns a 1=success. But if I FileCopy an EFS encrypted file, the FileCopy returns a 0=failure. The destination folder is located on my NAS (Network Attached Storage). There are no problemens whilst copying/moving (EFS and non-EFS) files If I drag&drop the file with Windows I get this nice little popup: "you are copying the file to a destination that does not support encryption" (with the possibility to stop or continue). I think my problems are not new and may go back some years when Microsoft first introduces EFS. I would like AutoIt to support EFS. My suggestions: 1) FileGetAttrib command. A new ReturnValueLetter. For example the "E" for Efs. 2) FileCopy/FileMove commands. A new flag allowing an EFS encrypted file to be copied whilst losing its encryption. I hope I've explained my problem/feature request properly (english is not my native language). Thank you for "listening". Kind regards, Gordon from The Netherlands My workaround for now looks like this: $Source = "D:\Test.txt" $Dest = "N:\" $Result = FileCopy($Source, $Dest, 1) If $Result = 0 Then $Result = RunWait(@ComSpec & " /c " & "Copy /D """ & $Source & """ """ & $Dest & """", "", @SW_MAXIMIZE) ;"/D" means "Allow the destination file to be created decrypted". If $Result <> 0 Then MsgBox(0, "Fail", "Both 'AutoIt FileCopy' and 'DOS Command Copy' failt!" & @LF & "Source=" & $Source & @LF & "Dest=" & $Dest) Exit EndIf EndIf Edited February 27, 2014 by GordonShumway Link to comment Share on other sites More sharing options...
JohnOne Posted February 27, 2014 Share Posted February 27, 2014 I think feature requests should go under bug reports in trac. Also, your English is good. Up until "englisch" AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
GordonShumway Posted February 27, 2014 Author Share Posted February 27, 2014 @JohnOne. Thank you. I've corrected my typo. Sorry for polluting the forum. I'll have a look into the tracker. Link to comment Share on other sites More sharing options...
orbs Posted February 27, 2014 Share Posted February 27, 2014 the internal Windows "copy" function prompts the Windows warning; but copy is composed of 2 steps: 1) read data from original file to memory, 2) write data from memory to new file. each one of these actions does not prompt the warning. so... MsgBox(0,'result:',MelmacFileCopy('C:\Temp\EFS\EFS.txt','\\NAS\SHARE\EFS.txt')) Func MelmacFileCopy($sSrcFile,$sDstFile) Local $hFile,$sFileContent $hFile=FileOpen($sSrcFile,16) $sFileContent=FileRead($hFile) FileClose($hFile) $hFile=FileOpen($sDstFile,16+2) Local $result=FileWrite($hFile,$sFileContent) FileClose($hFile) Return $result EndFunc now this is only a basic implementation; it lacks the ability to create the folder structure if it does not exist, or even to accept a folder name as destination rather than full file name. also it requires some better error handling. but hey, it works! i'm sure you can do the rest if you need to implement it in production. (Windows 7 x64 to Debian-based NAS, "C:tempEFS' is an encrypted folder) Signature - my forum contributions: Spoiler UDF: LFN - support for long file names (over 260 characters) InputImpose - impose valid characters in an input control TimeConvert - convert UTC to/from local time and/or reformat the string representation AMF - accept multiple files from Windows Explorer context menu DateDuration - literal description of the difference between given dates Apps: Touch - set the "modified" timestamp of a file to current time Show For Files - tray menu to show/hide files extensions, hidden & system files, and selection checkboxes SPDiff - Single-Pane Text Diff Link to comment Share on other sites More sharing options...
GordonShumway Posted March 2, 2014 Author Share Posted March 2, 2014 @Universalist. Thank you for your Melmac-copy! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now