Jump to content

Recommended Posts

Posted

Hi,

is it possible to delete folders using wildcards via AutoIt-script? I need to delete all folders with "test" in it's name.

Thanx

Berti

Posted

You could use FileRecycle followed by FileRecycleEmpty


Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Posted (edited)

If you have a path to the dir containing *test*.* or *test* in it then sure...

Dim $path = "C:/foo/bar/"

$fHwnd = FindFileFirst($path & "*test*")
while 1
     $file = FindFileNext($fHwnd)
     $dir = DirRemove($file)
     if(@error) then ExitLoop
     if($dir = 1)then MsgBox(0, "FileDeleter", "File " & $file & " Deleted!")
wEnd

MsgBox(0, "FileDeleter", "All files / folders in " & $path & " containing test have been deleted!")
Exit

I'm not sure if FindFileFirst/Next will return folders, pretty sure it does. Not sure if DirRemove will remove files.

You may also want to try




			
				


	Edited  by SiC_Goat
	
	

			
		

I AM ORCA!! A VERY POWERFUL WHALE!!!

Posted

_RunDOS("del /S /Q C:\test.*")

jeez does knowbody know about DOS???

How about doing it in CPM? DOS is for you youngsters...

;)

...by the way, it's pronounced: "JIF"... Bob Berry --- inventor of the GIF format
Posted

How about doing it in CPM? DOS is for you youngsters...

;)

\oh oh ohOH OH OHOHHHHHHH OH OH OHHHHHH

its on NOW!!

[right][font="Courier New"]...Run these streets all day, I can sleep when I die.[/font] [/right]

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
×
×
  • Create New...