Hina Posted April 17, 2009 Posted April 17, 2009 How can delete a folder on any location for example I create a folder @ desktop how can I delete it by autoit
Moderators Melba23 Posted April 17, 2009 Moderators Posted April 17, 2009 COMSATS,Look at DirRemove in that ever useful Help file.M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
Hina Posted April 17, 2009 Author Posted April 17, 2009 But if the folder is in for example D drive & I want that when D-Drive is open then that folder delete automatically how can I do that??
Moderators Melba23 Posted April 17, 2009 Moderators Posted April 17, 2009 COMSATS, A little more information on what you are trying to do, please. Are you opening the drive from within your script? Why do you need to delete the folder as soon as the drive is accessed? M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
Hina Posted April 17, 2009 Author Posted April 17, 2009 No I don't want to open the drive through my script. I want that 1st I create any empty folder in D drive then when I open the D-drive & folder with "h" name is present their it get deleted. can u give me the idea only?
Authenticity Posted April 17, 2009 Posted April 17, 2009 OK. So your script is creating the folder or the user is creating the folder? After the folder is created you want your script to be able to "recognize" the shell viewer is about the show the content of the D drive and before the user can see the content you want to delete the folder named "h"?
Hina Posted April 17, 2009 Author Posted April 17, 2009 Yes Yes U got it brother Authenticity now tell me how can I do that I am confuse I already tried WinExisit method but fail. Tell me how to do that. Thx for ur reply
Authenticity Posted April 17, 2009 Posted April 17, 2009 Try to set the folder attribute using the FileSetAttribute function to system attribute. It's unlikely that you'll find system which "Hide protected operating system files (Recommended)" is not checked in the folder options.
Hina Posted April 17, 2009 Author Posted April 17, 2009 But FileSetAttrib will not delete the folder infect it will remain @ the very same place but just hidden only brother
CodyBarrett Posted April 17, 2009 Posted April 17, 2009 if its +SH then you can't open the folder.... [size="1"][font="Tahoma"][COMPLETED]-----[FAILED]-----[ONGOING]VolumeControl|Binary Converter|CPU Usage| Mouse Wrap |WinHide|Word Scrammbler|LOCKER|SCREEN FREEZE|Decisions Decisions|Version UDF|Recast Desktop Mask|TCP Multiclient EXAMPLE|BTCP|LANCR|UDP serverless|AIOCR|OECR|Recast Messenger|AU3C|Tik-Tak-Toe|Snakes & Ladders|BattleShips|TRON|SNAKE_____________________[u]I love the Helpfile it is my best friend.[/u][/font][/size]
Hina Posted April 18, 2009 Author Posted April 18, 2009 Yes I know that by using "+SH" it will be supper hidden & won't open but it will remain @ the very same place
CodyBarrett Posted April 18, 2009 Posted April 18, 2009 then.... do what melba23 said DirRemove() are you wanting IF winexists() the dirremove() or.. if a process is viewing files then dirremove() ... then you want to do somethinig else [size="1"][font="Tahoma"][COMPLETED]-----[FAILED]-----[ONGOING]VolumeControl|Binary Converter|CPU Usage| Mouse Wrap |WinHide|Word Scrammbler|LOCKER|SCREEN FREEZE|Decisions Decisions|Version UDF|Recast Desktop Mask|TCP Multiclient EXAMPLE|BTCP|LANCR|UDP serverless|AIOCR|OECR|Recast Messenger|AU3C|Tik-Tak-Toe|Snakes & Ladders|BattleShips|TRON|SNAKE_____________________[u]I love the Helpfile it is my best friend.[/u][/font][/size]
Hina Posted April 18, 2009 Author Posted April 18, 2009 I already tried that thing that $a="Local Disk (D:)" If WinExsist($a)Then Dirremove($a&"\H") EndIf But this code dosen't work for me
Moderators Melba23 Posted April 18, 2009 Moderators Posted April 18, 2009 COMSATS,The solution is trivial - it takes me 8 lines of code. But I still want to know why you want to do this - something makes me think that deleting a folder the moment a drive is opened in Explorer is not something I want to help with. Unless you can prove me wrong, of course! :-)M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
Hina Posted April 18, 2009 Author Posted April 18, 2009 There is no wrong purpose behind this thing actually I am doing it to know that how can we remove, Move, Edit etc without giving the code full path rather than to associate it with the existance of a window. I do hope that U go the point plz share the code with me brother
Moderators Melba23 Posted April 18, 2009 Moderators Posted April 18, 2009 COMSATS,OK, I will trust you on this. ;-) This script deletes the folder "h" on the "D:" drive as soon as Explorer opens a window with the contents of the D: root folder:#include <Array.au3> While 1 $aArray = WinList() If _ArraySearch($aArray, "(D:)", 0, 0, 0, 1) <> -1 Then DirRemove("D:\h", 1) ExitLoop EndIf WEndM23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
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