Jump to content

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Find out more here. X
X


Photo

AutoIt Unlocker

unlock file in use directory unlocker

  • Please log in to reply
14 replies to this topic

#1 CaptainClucks

CaptainClucks

    Unum Cavillator Spuria

  • Active Members
  • PipPipPipPipPipPip
  • 1,227 posts

Posted 06 April 2012 - 06:41 PM

Posted Image

This was made with the intention to mimic the well known unlocker.exe.

Credits to Yashied, monoceres, wraithdu, Manko, Trancexx, JScript, Larry, SmOke_N, mrRevoked, Melba23 & guinness.

Spoiler


Attached File  Unlocker Source.rar   11.01KB   1087 downloads - [152] Previous Downloads

Alternately, download the exe from my site here, but sometimes my site is offline (a lot).
Some say taking and closing handles from a process can produce unwanted side effects in the targeted process, use with caution.

History
Spoiler

Edited by ApudAngelorum, 26 May 2012 - 06:36 PM.

  • Skrip likes this
Spoiler

Warning: Posts by this user are subject to change or may disappear without notice.








#2 guinness

guinness

    all-consuming swarm in inconspicuous disguise

  • Developers
  • 17,640 posts

Posted 06 April 2012 - 06:59 PM

I keep getting the an error message saying 'Error Code: 1 Extended 13.' I'm using the latest version on Windows 7 x64.

Edit: Credits to me? What did I do?

Edited by guinness, 06 April 2012 - 07:01 PM.

Example List: _AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrGeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()LockFile()Mapping CtrlIDsParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...
Updated: 26/09/2014


#3 TheSaint

TheSaint

    *** Knight Templar ***

  • MVPs
  • 5,839 posts

Posted 06 April 2012 - 07:00 PM

Thanks for sharing!

Make sure brain is in gear before opening mouth! Ignoring those who try to divert conversation with irrelevancies. If I put effort into communication, I expect you to read properly & fully, or just not comment. If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it. I'm only big and bad, to those who have an over-active imagination. I may have the Artistic Liesense to disagree with you. TheSaint's Toolbox


#4 BrewManNH

BrewManNH

    באָבקעס מיט קודוצ׳ה

  • MVPs
  • 10,596 posts

Posted 06 April 2012 - 07:10 PM

I'm getting the same error:

---------------------------
Error Code: 1 Extended: 13
---------------------------
The application has encounterd an error and will now close, sorry for the inconviniance.
---------------------------
OK
---------------------------

Also, don't limit the FileSelectFolder to the homedrive, because that's not allowing me to change drives to any other drive. My homedrive is set to a network share with only a few folders on it, none of which should be locked.

BTW, inconvenience is spelled wrong in that error message. ;)

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to an XP machine, and I'm not going to.

 

Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude

 

How to ask questions the smart way!

 

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.
Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.
_FileGetProperty - Retrieve the properties of a file SciTE Toolbar - A toolbar demo for use with the SciTE editorGUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.
GUIToolTip UDF Demo - Demo script to show how to use the GUIToolTip UDF to create and use customized tooltips. Latin Square password generator

 

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.


#5 CaptainClucks

CaptainClucks

    Unum Cavillator Spuria

  • Active Members
  • PipPipPipPipPipPip
  • 1,227 posts

Posted 06 April 2012 - 07:13 PM

I keep getting the an error message saying 'Error Code: 1 Extended 13.' I'm using the latest version on Windows 7 x64.

Edit: Credits to me? What did I do?


Well... I guess this would be a good time to post this...

Posted Image

But in all seriousness, I haven't tested this on any x64 bit systems and your post might prove it doesn't work on them, but aside from that I've tested this on windows xp sp3 x86 and windows 7 x86.

And the error you're getting means that the File and Process object handle types were not found, which is File = 28 and process = 5 on windows xp and windows 7 I believe.

And why not credits to you? Remember this thread? If it weren't for your help there this probably wouldn't be here.

I'm getting the same error:

Also, don't limit the FileSelectFolder to the homedrive, because that's not allowing me to change drives to any other drive. My homedrive is set to a network share with only a few folders on it, none of which should be locked.

BTW, inconvenience is spelled wrong in that error message. :)


Thanks for pointing that out, I hadn't noticed and too bad scite doesn't spell check like my browser ;)

Ieme fix that..

Thanks for sharing!

You're welcome! :D

Edited by ApudAngelorum, 06 April 2012 - 08:34 PM.

Spoiler

Warning: Posts by this user are subject to change or may disappear without notice.


#6 guinness

guinness

    all-consuming swarm in inconspicuous disguise

  • Developers
  • 17,640 posts

Posted 06 April 2012 - 08:08 PM

Just a question, but the functions you used from WinAPIEx.au3 did you alter them in anyway, because the UDF has been tested on x64 thoroughly.

Example List: _AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrGeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()LockFile()Mapping CtrlIDsParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...
Updated: 26/09/2014


#7 CaptainClucks

CaptainClucks

    Unum Cavillator Spuria

  • Active Members
  • PipPipPipPipPipPip
  • 1,227 posts

Posted 06 April 2012 - 08:26 PM

Just a question, but the functions you used from WinAPIEx.au3 did you alter them in anyway, because the UDF has been tested on x64 thoroughly.

If you notice, I only took the one function from that UDF and it's ZwQuerySystemInformation, and since you got to error level 13 returned in the extended macro, then this means the function taken from winapiex works flawlessly, I don't have an x64 bit machine handy but maybe you could try commenting out this line~

If DllStructGetData($tHandle, 1) <> @AutoItPID Then ContinueLoop; only search our process for now


What it's doing is making sure we're trying to look for the object handle types in our process only (I.e., File = 28 on win xp and file = 25 on vista), but I doubt it will work, there must be something else at play here..


For an object of type file, the value bObjectType in SYSTEM_HANDLE is 28 in Windows XP, Windows 2000, and Window 7; 25 in Windows Vista; and 26 in Windows 2000.


If you comment out that line then maybe it will work? give it a try.

Or else just populate the $FileObject array yourself with the valid object type values depending on your system, read the link above.
On windows vista this would probably be right.

$aObject[$Ready][0] = DllStructGetData($tHandle, 2);return it so we can use it to find them $aObject[$Ready][1] = DllStructGetData($tString, 1) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ $aObject[$Ready][0] = 25 $aObject[$Ready][1] = "File"

Edited by ApudAngelorum, 06 April 2012 - 08:38 PM.

Spoiler

Warning: Posts by this user are subject to change or may disappear without notice.


#8 guinness

guinness

    all-consuming swarm in inconspicuous disguise

  • Developers
  • 17,640 posts

Posted 06 April 2012 - 09:09 PM

I tried commenting out but to no avail. I'll have a look over the next week or so. Thanks.

Example List: _AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrGeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()LockFile()Mapping CtrlIDsParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...
Updated: 26/09/2014


#9 wraithdu

wraithdu

    this noise inside my head

  • MVPs
  • 2,413 posts

Posted 06 April 2012 - 09:13 PM

monoceres started a script like this a while back, and I did some work on it too. It proved tricky and ultimately incomplete. Maybe you can borrow something from it: http://www.autoitscript.com/forum/topic/83145-basic-file-unlocker/

#10 CaptainClucks

CaptainClucks

    Unum Cavillator Spuria

  • Active Members
  • PipPipPipPipPipPip
  • 1,227 posts

Posted 06 April 2012 - 09:18 PM

monoceres started a script like this a while back, and I did some work on it too. It proved tricky and ultimately incomplete. Maybe you can borrow something from it: http://www.autoitscript.com/forum/topic/83145-basic-file-unlocker/

Thanks, I've actually already scavenged that post, hence the credits to monoceres, what I took from there that I needed was the part of the script that determines what drive label to use. If you downloaded the script, look closely and you'll recognize some of the code, I didn't change the variables.

 Local $struct = DllStructCreate("char[255];") Local $Temp = DriveGetDrive("ALL") Local $drivesinfo[UBound($Temp) - 1][2] For $I = 0 To UBound($drivesinfo) - 1   $drivesinfo[$I][0] = $Temp[$I + 1]   DllCall($hKERNEL32, "dword", "QueryDosDevice", "str", $drivesinfo[$I][0], "ptr", DllStructGetPtr($struct), "dword", 255)   $drivesinfo[$I][1] = DllStructGetData($struct, 1) Next ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~     DllCall($hNTDLL, "ulong", "NtQueryObject", "ptr", $hObject, "int", 1, "ptr", DllStructGetPtr($poti), "ulong", DllStructGetSize($poti), "ulong*", "")     $devicestr = DllStructCreate("wchar[" & Ceiling(DllStructGetData($poti, "Length") / 2) & "];", DllStructGetData($poti, "buffer"))     $devicestr = DllStructGetData($devicestr, 1)


Edit: wow, after taking a closer look I noticed that code is actually by you, let me fix my first post ;)

Edited by ApudAngelorum, 06 April 2012 - 09:20 PM.

Spoiler

Warning: Posts by this user are subject to change or may disappear without notice.


#11 CaptainClucks

CaptainClucks

    Unum Cavillator Spuria

  • Active Members
  • PipPipPipPipPipPip
  • 1,227 posts

Posted 06 April 2012 - 10:08 PM

I tried commenting out but to no avail. I'll have a look over the next week or so. Thanks.


Ok, so I hit up a friend with a 64bit system and I tried debugging the script for a few minutes and found out that it is in fact the function that I previously said executed flawlessly, it turns out that even in its original form (straight out of the winapiex UDF) it does not return the desired information.

The function in question is _WinAPI_EnumProcessHandles() which should return file handles in an array and is basically the heart of this script...

MSDN mentions nothing about incompatibility on any system so I'm guessing this is a bug in the function?

Anyway, with a little help from the community running 64bit OSs, this could turn out to be a pretty handy tool, I use it a lot to unlock directories locked by scite and other apps, but as for debugging this for 64bit systems, I just don't have the resources or the know how to do it.

Edited by ApudAngelorum, 06 April 2012 - 11:30 PM.

Spoiler

Warning: Posts by this user are subject to change or may disappear without notice.


#12 CaptainClucks

CaptainClucks

    Unum Cavillator Spuria

  • Active Members
  • PipPipPipPipPipPip
  • 1,227 posts

Posted 26 May 2012 - 06:39 PM

Added support for 64bit systems as it seems thanks to yashied for an update he made to a function from his winapiex udf that I use that is critical to everything in the script.
Spoiler

Warning: Posts by this user are subject to change or may disappear without notice.


#13 wazer

wazer

    Wayfarer

  • Active Members
  • Pip
  • 61 posts

Posted 20 October 2012 - 10:55 PM

i really liked unlocker back in the days on XP, but then i moved to windows 7/8, since then unlocker has never really worked well,

Now i saw this topic, yours dont work as i expected, i run it, select the folder then it gets stuck at 3/6, at last the windows ask if you want to end it since its not responding anymore.

So is there an update coming for windows 8?

#14 DigitalFacade82

DigitalFacade82

    Wayfarer

  • Active Members
  • Pip
  • 53 posts

Posted 17 June 2013 - 04:05 PM

3qjgv2.jpg

 

Ok so firstly I acknowledge that I am necrobumping this thread badly, and the OP probably wants it dead. But I came to offer some feedback and possibly a solution?

I have without knowing been using this small application for a while for various things. And for the most part is has been pretty good, however when some stubbon apps just don't want to die unlocker gives up and basically offers to remove it on reboot, to which it never does. Anyway that is not my point and I didn't come here to bitch and whinge and complain I came here with some info on what I discovered.

Second point I want to make here, is to the OP. Man you are a legend. I see so much of your stuff contributed to this forum. You are an incredible asset to this place. I have been a long long time lurker on here, and only recently become a member, mostly because up until now I am smart enough to use the search function, read the help and have felt that I have not got anything worth offering to this forum that others haven't already said done or tried. I guess I was a feeling a little unworthy around such greats? Sooo. I am here. I came on cause I wanted to request some things of the dev for ISN AutoIT Studio....so now I am a member I can post. Before now I am thinking 'Should I say something? Nah some admin with roast this n00b...I think I best go get some popcorn instead....plus I'm too lazy to sign up'

Ok so.....getting back on track.

My situation and god only knows why the hell this is happening? I am an Android developer/hacker/enthusiest (secretly an autoIT one too but shhhh). I use Android Debug Bridge and Android Asset Packaging Tool (aapt.exe) for a lot of stuff in Windows. On numerous occassions now I have duplicate processes running for aapt? I have to right click task manager and end each one. Some respawn even for some unknown reason? Sometimes this locks apks, and typically only apks that have been signed with a system certificate? Yeah try explaining that one? And more so these than others.....actually pretty much of late if I drop a system apk in a windows directory it is superglued there. So long as I do not select the apk in that directory and then unselect it and leave it....and come back hoping to move or delete or what ever (cause you can't....like ever!). Pretty much if I have selected an system apk for the first time I better do something with it, cut and paste it somewhere, cause I get no second bites at the cherry. I can even cut and paste it where it is and that is ok??? Yeah crazy eh?

So...using you app does absolutely nothing in nearly all causes. It doesn't remove the apk. It doesn't remove it on next boot. The only thing I can *sometimes* do is navigate to the directory and use my keyboard with arrow keys (not my mouse? It has something to do with my mouse?) press the first letter of the name of the apk, like a for android.apk and then press the delete button and hope to god that my delete got to it before aapt did?

Heres the cool part though....sorry for boring you here with all of the details, I just felt it necessary to explain to save future questioning. Anyway I got so freakin mad the other day because I was not able to change frameworks and apktool was ummm.....whats an analogy for this? Umm it was like stuck in first gear. Think of changing frameworks as like changing gears. I could not remove the existing framework cause I had clicked on it bla bla bla.

So I made a quick and dirty script.

I had your unlocker running and churning away at the file doing it's best (sometimes it works? so hey why not) but not really succeeding in doing anything. So I right click the apk in question and killed all the aapt processes (keep killing in a loop till there is none) and this worked! File deleted :)

I would imagine that you could essentially use the same "skeleton" of the kill script I use, but have all the fancy stuff like checking hwnd of the $CmdLineRaw.... I would create an array of all the listed processes keeping the selected file open and then just pass each and every one of those into the process kill loop function until they are all dead and then when once dead, offer to delete move or what ever the user wants to do with the file. Process first and then offer. At the moment the user is choosing an option and then never getting it or maybe sometimes? Clicking any of the buttons should first initiate the same function on all of them, then when move, or then delete. You can't actually do anything until all the processes are gone anyway right? 
But don't get me wrong all the fancy stuff you had going on in your script was great and when reading it, I was a little overwhelmed (how the hell do you think all of this up?)....nothing wrong with it, but sometimes simple works. I only know simple at the moment.....

Also on that note, I am not certain of this 100% but I think the issue with your script is not to do with your structure or anything, but I think that there maybe an issue with the Processclose functionality of AutoIT?
I am technically a n00b, but I have never found Processclose to be successful with much. It lacks rigor and consistency. However quick and dirty ol command line driven traditional Windows "taskkill" will nearly always get the job done! Even when your at the point of complete stackover load and loosing your sh!t taskkill (if you can move your slow motion mouse to the taskmanager window before BSOD) will save you. AutoIT Processclose though? I highly doubt it....actually I would call it game over and walk away knowing my PC is about flip leaving a nasty dmp file to remind me I am idiot :D

Oh umm here is my script....this will be my first contribution to the forums :D I feel special knowing that no one will probably ever use this haha

 

AutoIt         
#region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Icon=..\..\..\AppData\Icons\AndroidKilled.ico #AutoIt3Wrapper_Outfile=AAPT-KILL.exe #AutoIt3Wrapper_UseX64=n #endregion ;**** Directives created by AutoIt3Wrapper_GUI **** #cs ----------------------------------------------------------------------------     Name ..........: AAPT-Kill     Description ...: Right click integrates to context menu Usage: This script is used to kill respawned                      aapt processes that will not allow a user to move an apk file     Syntax ........: NA     Parameters ....: NA     Return values .: User selected apk is killed from right click, stays in loop until the thing is f#*%ing dead dead     Author ........: Jarmezrocks XDA Developers / Digitalfacade82 AutoIT forums     Example .......: What? This is an example!     Credits .......: MHz for his example to a n00b demonstrating right click functionality http://www.autoitscript.com/forum/topic/32788-right-click-context-menu-functionality/     : guinness for his _Process Kill example in the AutoIT snippets http://www.autoitscript.com/wiki/Snippets_(_Windows_Settings_)     AutoIt Version: 3.3.8.1 #ce ---------------------------------------------------------------------------- #region - Includes #include <Constants.au3> #endregion #region - Global Variables Global Const $REG_KEY = 'HKLM\SOFTWARE\Classes\.apk\shell\AAPT KILL' #endregion #region - CmdlineSwitch Func _ContextIntegration()     If $CMDLINE[0] Then         For $i = 1 To $CMDLINE[0]             Switch $CMDLINE[$i]                 Case '/?'                     MsgBox(0x40000, StringTrimRight(@ScriptName, 4) & ' Help', _                             'Switches are:' & @LF _                              & @LF & '/extract' _                              & @LF & @TAB & 'Extract files to current directory' _                              & @LF & '/register' _                              & @LF & @TAB & 'Add registration into context menu' _                              & @LF & '/unregister' _                              & @LF & @TAB & 'Remove registration from context menu')                     Exit                 Case '/extract' ;~              FileInstall('?', @ScriptDir & '\')                     Exit                 Case '/register'                     RegWrite($REG_KEY, '', 'Reg_sz', 'AAPT-kill')                     RegWrite($REG_KEY, 'Icon', 'Reg_sz', Chr(34) & @ScriptFullPath & Chr(34)); Adds an Icon to the app in the context menu                     RegWrite($REG_KEY & '\Command', '', 'Reg_sz', '"' & @ScriptFullPath & '" "%1"')                     MsgBox(0x40000, 'AAPT-kill', 'Registered')                     Exit                 Case '/unregister'                     RegDelete($REG_KEY)                     MsgBox(0x40000, 'AAPT-kill', 'UnRegistered')                     Exit                 Case Else                     Const $FILE_PATH = $CMDLINE[$i]                     If Not FileExists($FILE_PATH) Then                         MsgBox(0x40030, 'AAPT-kill', 'File parameter is invalid')                         Exit                     EndIf             EndSwitch         Next     Else         If RegRead($REG_KEY, '') Then             If MsgBox(0x40021, @ScriptName, 'Do you want to remove ' & @ScriptName & ' from the right click context menu?' & @CRLF & 'Press OK to continue') = $IDOK Then                 RegDelete($REG_KEY)             EndIf         Else             If MsgBox(0x40021, @ScriptName, 'Do you want to add ' & @ScriptName & ' from the right click context menu?' & @CRLF & 'Press OK to continue') = $IDOK Then                 RegWrite($REG_KEY, '', 'Reg_sz', 'AAPT-kill')                 RegWrite($REG_KEY, 'Icon', 'Reg_sz', Chr(34) & @ScriptFullPath & Chr(34)); Adds an Icon to the app in the context menu                 RegWrite($REG_KEY & '\Command', '', 'Reg_sz', '"' & @ScriptFullPath & '" "%1"')             EndIf         EndIf         Exit     EndIf EndFunc   ;==>_ContextIntegration #endregion Func _ProcessKill()     Local $iTimeOut = 5, $iTimer     Local $iPID = ('aapt.exe')     $iTimeOut *= 1000     $iTimer = TimerInit()     While ProcessExists($iPID)         If TimerDiff($iTimer) > $iTimeOut Then             ExitLoop         EndIf         RunWait('TASKKILL /F /T /IM ' & $iPID, @SystemDir & "\", @SW_HIDE)         Sleep(20)     WEnd     Return Number(ProcessExists($iPID) > 0) EndFunc   ;==>_ProcessKill _ContextIntegration() _ProcessKill() MsgBox(0, 'Congratulations!!',  'You probably just killed a bucket load of aapt.exes'  & @CRLF &'stopping you from moving or deleting:'& @CRLF & "" & @CRLF & $CmdLineRaw, 10)

Edited by DigitalFacade82, 17 June 2013 - 04:26 PM.


#15 mesale0077

mesale0077

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 484 posts

Posted 19 August 2014 - 08:35 AM

Unlocker source update coming for windows 7 and windows 8?





Also tagged with one or more of these keywords: unlock, file in use, directory unlocker

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users