Jump to content

Recommended Posts

Posted
How can delete a folder on any location for example I create a folder @ desktop how can I delete it by autoit
  • Moderators
Posted

COMSATS,

Look at DirRemove in that ever useful Help file.

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Posted

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
Posted

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

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Posted

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?

Posted

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"?

Posted

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

Posted

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.

Posted

But FileSetAttrib will not delete the folder infect it will remain @ the very same place but just hidden only brother

Posted

if its +SH then you can't open the folder....

Posted

Yes I know that by using "+SH" it will be supper hidden & won't open but it will remain @ the very same place

Posted

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

Posted

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
Posted

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

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Posted

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
Posted

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
WEnd

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...