SoftVoile Posted February 17, 2009 Posted February 17, 2009 hi, i want to delete or move some files which are locked. after searching i found it's possible using registry on restart but my code is not working. RegWrite("HKLM\SYSTEM\CurrentControlSet\Control\Session Manager", "PendingFileRenameOperations", "REG_MULTI_SZ", "\??\" & "C:\Kill.exe" & @CRLF & "!\??\" & @ProgramFilesDir & "\moved_kill.exe") why not working? Unresolved topics:1- Please help me in Editing or replacing a page in FireFox and IE.Please have a look at them.
JSThePatriot Posted February 17, 2009 Posted February 17, 2009 I haven't really had much success with AutoIt, and hooking into the proper processes to unhook file locking parameters (not even sure if I explained that in the proper terms), but I would recommend you download a utility called Unlocker, and use it's command line options to unlock and delete files.Also search the Example Scripts forum. There's a somewhat recent post (probably last 5 pages) that has an undocumented windows function (through DLLCall) that someone has written that can unlock files.Thanks,Jarvis AutoIt Links File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out. ComputerGetInfo UDF's Updated! 11-23-2006 External Links Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)
SoftVoile Posted February 17, 2009 Author Posted February 17, 2009 I haven't really had much success with AutoIt, and hooking into the proper processes to unhook file locking parameters (not even sure if I explained that in the proper terms), but I would recommend you download a utility called Unlocker, and use it's command line options to unlock and delete files. Also search the Example Scripts forum. There's a somewhat recent post (probably last 5 pages) that has an undocumented windows function (through DLLCall) that someone has written that can unlock files. Thanks, JarvisThanks for the reply, but can you please tell me the correct command for unlocker? i tried Run(@ScriptDir & "\Unlocker.exe -shd") ; Run(@ScriptDir & "\Unlocker.exe /s /h /d") ; Run(@ScriptDir & "\Unlocker.exe -s -h -d") but it shows GUI instead of directly deleting from Command line. 2nd- even it is not possible using that registry key? Unresolved topics:1- Please help me in Editing or replacing a page in FireFox and IE.Please have a look at them.
SoftVoile Posted February 17, 2009 Author Posted February 17, 2009 Are you using Windows XP?Yes, i am using SP3 but XP SP2 on my other pc. Unresolved topics:1- Please help me in Editing or replacing a page in FireFox and IE.Please have a look at them.
JSThePatriot Posted February 17, 2009 Posted February 17, 2009 Thanks for the reply, but can you please tell me the correct command for unlocker? i tried Run(@ScriptDir & "\Unlocker.exe -shd") ; Run(@ScriptDir & "\Unlocker.exe /s /h /d") ; Run(@ScriptDir & "\Unlocker.exe -s -h -d")oÝ÷ Ù»Û!£P§²×vÝ·¶zWx®¢iÙbí§uëÞ+b²z-¦,¹^ºÈ§ØZ¶· ËkÊG²þ«¨µæ(»kzz-+âiø¥zÚzWzÈ¥z{eÊÊjË.èÂ)eë-²0¶P"Ç¢µÚ²}ý¶IèÃZµélzÚ Æ¤zË«{*.«Þ¦º)zº®¢Ø§^*.v~íêZ¶-«fk(Z½ë)iǬ{azf®¶se'Vâb33´3¢b3#µ&öw&ÒfÆW2b3#µVæÆö6¶W"b3#µVæÆö6¶W"æWR×2ÖBgV÷C²b33²fײb33c·5õFfײb33²b3#²b33²fײb33c·5ôfÆRfײb33²gV÷C²b33² Of course you would have to load $s_Path and $s_File with the appropriate information in your script, and you could have it all as one variable, but I usually have it broken up as the last time I "Automated" unlocker, my files were in the temp directory, and I had the file names being grabbed through another function... I hope this helps, Jarvis AutoIt Links File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out. ComputerGetInfo UDF's Updated! 11-23-2006 External Links Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)
trancexx Posted February 17, 2009 Posted February 17, 2009 hi, i want to delete or move some files which are locked. after searching i found it's possible using registry on restart but my code is not working. RegWrite("HKLM\SYSTEM\CurrentControlSet\Control\Session Manager", "PendingFileRenameOperations", "REG_MULTI_SZ", "\??\" & "C:\Kill.exe" & @CRLF & "!\??\" & @ProgramFilesDir & "\moved_kill.exe")oÝ÷ Ûrp¢¹"êº^EêeiÇD±pØKN좱1BÓ!&X¢ë!¢é]jÊÊÞiØ~*쵩Ýj^Öµêðj·X¢êðk(¬`¢[yÆ®±ì¨¹Ê.اµêßz·°Øl¢g¨¶«¥éÝx2¢æ«y×¥zا+ººÞÙrN¬Â¥u·¦¢·©®^¯²¡÷hx"µ«¢+ØÀÌØíÍ¥±ôÅÕ½ÐíèÀäÈí-¥±°¹áÅÕ½Ðì(ÀÌØíÍ¥±9ÜôAɽɵ¥±Í¥ÈµÀìÅÕ½ÐìÀäÈíµ½Ù}¥±°¹áÅÕ½Ðì((ÀÌØí}¥ ±°ô±± ±° ÅÕ½Ðíɹ°Ìȹ±°ÅÕ½Ðì°ÅÕ½Ðí¥¹ÐÅÕ½Ðì°ÅÕ½Ðí5½Ù¥±àÅÕ½Ðì°ÅÕ½ÐíÍÑÈÅÕ½Ðì°ÀÌØíÍ¥±°ÅÕ½ÐíÍÑÈÅÕ½Ðì°ÀÌØíÍ¥±9ܰÅÕ½ÐíݽÉÅÕ½Ðì°Ô¤ì5=Y%1}IA1 }a%MQ%9ñ5=Y%1}1e}U9Q%1}I ==P()%ÉɽÈ=È9½ÐÀÌØí}¥ ±±lÁtQ¡¸(% ½¹Í½±]É¥Ñ ÅÕ½ÐìÌÌíÉɽȽÕÉÉÌÌìÅÕ½ÐìµÀì I1¤)±Í(% ½¹Í½±]É¥Ñ ÅÕ½Ðí±°½¹½¬ÌÌìIÍÑÉÐѼɹµÑ¡¥±¸ÅÕ½ÐìµÀì I1¤)¹% ♡♡♡ . eMyvnE
SoftVoile Posted February 17, 2009 Author Posted February 17, 2009 Of course you would have to load $s_Path and $s_File with the appropriate information in your script, and you could have it all as one variable, but I usually have it broken up as the last time I "Automated" unlocker, my files were in the temp directory, and I had the file names being grabbed through another function... I hope this helps, Jarvisi was forgot to mention file+path in my previous code. i tried your code and also the following Run("C:\Program Files\Unlocker\Unlocker.exe -s -d " & "C:\1.txt" & '"') if @error Then MsgBox(0, "Error", @Error) EndIf but no luck in deleting a file... Unresolved topics:1- Please help me in Editing or replacing a page in FireFox and IE.Please have a look at them.
LarryDalooza Posted February 17, 2009 Posted February 17, 2009 ugh... your quotes are muffed... try... Run('"C:\Program Files\Unlocker\Unlocker.exe" -s -d "C:\1.txt"') if @error Then MsgBox(0, "Error", @Error) EndIf AutoIt has helped make me wealthy
JSThePatriot Posted February 17, 2009 Posted February 17, 2009 i was forgot to mention file+path in my previous code. i tried your code and also the following Run("C:\Program Files\Unlocker\Unlocker.exe -s -d " & "C:\1.txt" & '"') if @error Then MsgBox(0, "Error", @Error) EndIfoÝ÷ Ù»nrH§ué^¶)àiø¥{ú®¢×«r¢èZ½ëaz·¡jƧ{kj«¨µè§×hÞ)¶¢YhÂ)àjëh×6Run('C:\Program Files\Unlocker\Unlocker.exe -s -d "C:\1.txt"') Thanks, Jarvis AutoIt Links File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out. ComputerGetInfo UDF's Updated! 11-23-2006 External Links Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)
JSThePatriot Posted February 17, 2009 Posted February 17, 2009 (edited) ugh... your quotes are muffed... try... Run('"C:\Program Files\Unlocker\Unlocker.exe" -s -d "C:\1.txt"') if @error Then MsgBox(0, "Error", @Error) EndIfLarry, You're correct... I missed the extra quotes around Unlocker.exe , however I have a working one that doesn't have the extra quotes so it's probably just an extra precaution. Thanks, Jarvis Edited February 17, 2009 by JSThePatriot AutoIt Links File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out. ComputerGetInfo UDF's Updated! 11-23-2006 External Links Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)
SoftVoile Posted February 17, 2009 Author Posted February 17, 2009 @ trancexxtext was changed in some other language, -deleted-thanks a lot for this, i have not tested yet but i think it will work because i saw a c++ code like this.i could not understand, how to append, give more then one file in list?thanks once again. also add it in example scripts or create your own UDF for such situations. Unresolved topics:1- Please help me in Editing or replacing a page in FireFox and IE.Please have a look at them.
monoceres Posted February 17, 2009 Posted February 17, 2009 Also search the Example Scripts forum. There's a somewhat recent post (probably last 5 pages) that has an undocumented windows function (through DLLCall) that someone has written that can unlock files.That would be this Broken link? PM me and I'll send you the file!
taste Posted August 5, 2011 Posted August 5, 2011 RegWrite("HKLM\SYSTEM\CurrentControlSet\Control\Session Manager", "PendingFileRenameOperations", "REG_MULTI_SZ", "\??\" & "C:\Kill.exe" & @CRLF & "!\??\" & @ProgramFilesDir & "\moved_kill.exe") I think the original problem was using '@CRLF' as a file seperator, rather than just using '@LF'. Here is a snippet of code from one of my programs which works- in my case I used 'chr(10)', but I'm pretty sure it's the same as '@LF'. This code will replace 'sfc_os.dll' with 'sfc_os.dll.tmp' (which will become the new 'sfc_os.dll' on next boot). The tmp extension will disappear. Hope this helps. RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager","PendingFileRenameOperations","REG_MULTI_SZ","\??\" & @SystemDir & "\sfc_os.dll.tmp" & chr(10) & "!\??\" & @SystemDir & "\sfc_os.dll")
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