Belini Posted October 5, 2017 Author Posted October 5, 2017 The tip of @Luigi was very good yes and I was able to release the file just to run and can no longer copy the file! My Codes: Virtual Key Code UDF: http://www.autoitscript.com/forum/topic/138246-virtual-key-code-udf/ GuiSplashTextOn.au3: http://www.autoitscript.com/forum/topic/143542-guisplashtexton-udf/ Menu versions of Autoit: http://www.autoitscript.com/forum/topic/137435-menu-versions-of-autoit/#entry962011 Selects first folder of letters: ]http://www.autoitscript.com/forum/topic/144780-select-folders-by-letter/#entry1021708/spoiler] List files and folders with long addresses.: http://www.autoitscript.com/forum/topic/144910-list-files-and-folders-with-long-addresses/#entry102 2926 Program JUKEBOX made in Autoit:some functions:http://www.youtube.com/watch?v=WJ2tC2fD5Qs Navigation to search:http://www.youtube.com/watch?v=lblwOFIbgtQ
kader1303 Posted March 6, 2020 Posted March 6, 2020 (edited) On 10/5/2017 at 8:53 AM, Belini said: The tip of @Luigi was very good yes and I was able to release the file just to run and can no longer copy the file! Hi, How did You manage to realese the file just to run. I have the same trouble and need to prevent running exe from been copied Edited March 6, 2020 by kader1303
argumentum Posted March 6, 2020 Posted March 6, 2020 .. lock the file. Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting.
kader1303 Posted March 6, 2020 Posted March 6, 2020 (edited) On 9/17/2017 at 2:47 PM, Belini said: @UEZ _WinAPI_LockFile () can prevent copying but does not let the player play the video too and if I put the video to play before _WinAPI_LockFile () can not protect because the video is already playing! #include <GDIPlus.au3> #include <GUIConstantsEx.au3> #include <WinAPIFiles.au3> Example() Func Example() Local $iW = 600, $iH = 400, $iW2 = $iW / 2, $iH2 = $iH / 2 Local $hGUI = GUICreate("GDI+ Example", 600, 400) GUISetState(@SW_SHOW) _GDIPlus_Startup() ;lock the file Local $file = @ScriptDir & "\video.mp4" ;----------------------------------------------------------- Local $hFile = _WinAPI_CreateFile($file, 2, 2, 0) _WinAPI_LockFile($hFile, 0, FileGetSize($file)) ;----------------------------------------------------------- ; Loop until the user exits. Do Until GUIGetMsg() = $GUI_EVENT_CLOSE _GDIPlus_Shutdown() ;Unlock the file ;----------------------------------------------------------- _WinAPI_UnlockFile($hFile, 0, FileGetSize($file)) _WinAPI_CloseHandle($hFile) ;----------------------------------------------------------- EndFunc ;==>Example Is happening to me as Bellini sayd here, if I locked file before running can't execute it, and if I do it after, isn't blocked then, as per his final post here I understand that he was able to lock file before run it and then release it just for read. Edited March 6, 2020 by kader1303
Belini Posted March 6, 2020 Author Posted March 6, 2020 @kader1303 for executable files I never tried, what I was trying to block were video files during the execution of it because they are encrypted but they are decrypted when you are going to run this unencrypted file, i managed to disable this file if someone can copy it while it is running. My Codes: Virtual Key Code UDF: http://www.autoitscript.com/forum/topic/138246-virtual-key-code-udf/ GuiSplashTextOn.au3: http://www.autoitscript.com/forum/topic/143542-guisplashtexton-udf/ Menu versions of Autoit: http://www.autoitscript.com/forum/topic/137435-menu-versions-of-autoit/#entry962011 Selects first folder of letters: ]http://www.autoitscript.com/forum/topic/144780-select-folders-by-letter/#entry1021708/spoiler] List files and folders with long addresses.: http://www.autoitscript.com/forum/topic/144910-list-files-and-folders-with-long-addresses/#entry102 2926 Program JUKEBOX made in Autoit:some functions:http://www.youtube.com/watch?v=WJ2tC2fD5Qs Navigation to search:http://www.youtube.com/watch?v=lblwOFIbgtQ
kader1303 Posted March 6, 2020 Posted March 6, 2020 17 minutes ago, Belini said: @kader1303 for executable files I never tried, what I was trying to block were video files during the execution of it because they are encrypted but they are decrypted when you are going to run this unencrypted file, i managed to disable this file if someone can copy it while it is running. Mabe I can do the same, how did you disable your file while running for being copied? can You share some example code, anyway i'll keep testing and share final results
Belini Posted March 6, 2020 Author Posted March 6, 2020 I used the _WinAPI_LockFile () that @argumentum indicated above but it will not work with executable files. My Codes: Virtual Key Code UDF: http://www.autoitscript.com/forum/topic/138246-virtual-key-code-udf/ GuiSplashTextOn.au3: http://www.autoitscript.com/forum/topic/143542-guisplashtexton-udf/ Menu versions of Autoit: http://www.autoitscript.com/forum/topic/137435-menu-versions-of-autoit/#entry962011 Selects first folder of letters: ]http://www.autoitscript.com/forum/topic/144780-select-folders-by-letter/#entry1021708/spoiler] List files and folders with long addresses.: http://www.autoitscript.com/forum/topic/144910-list-files-and-folders-with-long-addresses/#entry102 2926 Program JUKEBOX made in Autoit:some functions:http://www.youtube.com/watch?v=WJ2tC2fD5Qs Navigation to search:http://www.youtube.com/watch?v=lblwOFIbgtQ
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