vaibhavs Posted February 12, 2008 Share Posted February 12, 2008 Hi, I have a simple apps which prevents PC users from deleting files & Folders. I envoke this apps via registry on bootup. HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run Created new STRING VALUES [DoDel] DoDel = c:\windows\DoDel.exe Opt("TrayIconHide", 1) while 1 WinKill("Confirm File Delete", "") WinKill("Confirm Multiple File Delete", "") WinKill("Confirm Folder Delete", "") WEnd Many times, I see that this apps uses 80-90% of CPU resources. I have not idea why? Can someone share their thoughts on the possibility or some way to diagnose it. Vai Link to comment Share on other sites More sharing options...
DW1 Posted February 12, 2008 Share Posted February 12, 2008 (edited) Put a sleep in there, you are maxing out the processor by completing that loop as fast as the processor allows EDIT: Sleep(10) would do the trick Edited February 12, 2008 by danwilli AutoIt3 Online Help Link to comment Share on other sites More sharing options...
Xenobiologist Posted February 12, 2008 Share Posted February 12, 2008 Hi, look at sleep Mega Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times Link to comment Share on other sites More sharing options...
GEOSoft Posted February 12, 2008 Share Posted February 12, 2008 Hi, I have a simple apps which prevents PC users from deleting files & Folders. I envoke this apps via registry on bootup. HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run Created new STRING VALUES [DoDel] DoDel = c:\windows\DoDel.exe Opt("TrayIconHide", 1) while 1 WinKill("Confirm File Delete", "") WinKill("Confirm Multiple File Delete", "") WinKill("Confirm Folder Delete", "") WEnd Many times, I see that this apps uses 80-90% of CPU resources. I have not idea why? Can someone share their thoughts on the possibility or some way to diagnose it. VaiOpt("TrayIconHide", 1) while 1 If WinExists("Confirm File Delete", "") Then WinKill("Confirm File Delete", "") If WinExists("Confirm Multiple File Delete", "") Then WinKill("Confirm Multiple File Delete", "") If WinExists("Confirm Folder Delete", "") Then WinKill("Confirm Folder Delete", "") Sleep(10) WEnd George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!" Link to comment Share on other sites More sharing options...
vaibhavs Posted February 13, 2008 Author Share Posted February 13, 2008 I will try the sleep(10). Thx a ton to all. Cheers, Vai Link to comment Share on other sites More sharing options...
Squirrely1 Posted February 13, 2008 Share Posted February 13, 2008 If you don't tell them how you exit the program, you can use Alt+Shift+F7 to exit this version: Opt("TrayIconHide", 1) HotKeySet("+!{F7}", "ExitProggy") Sleep(280) EmptyWorkingSet() While 1 If WinExists("Confirm File Delete") Then WinKill("Confirm File Delete") EndIf Sleep(4) If WinExists("Confirm Multiple File Delete") Then WinKill("Confirm Multiple File Delete", "") EndIf Sleep(4) If WinExists("Confirm Folder Delete") Then WinKill("Confirm Folder Delete") EndIf Sleep(11) WEnd Func EmptyWorkingSet() ;Puts as much of the script as possible onto the paging file ;Author: wOuter (mostly) Sleep(300) DllCall("psapi.dll", 'int', 'EmptyWorkingSet', 'long', -1) Sleep(1380) EndFunc ;==>EmptyWorkingSet Func ExitProggy() Exit EndFunc ;==>ExitProggy Das Häschen benutzt Radar Link to comment Share on other sites More sharing options...
James Posted February 13, 2008 Share Posted February 13, 2008 Hey this would be good if you could tell where the file delete was coming from e.g. Windows! Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ 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