RacecarSoft Posted August 16, 2008 Posted August 16, 2008 Is there a way to have a wild card? Like if I wanted to make a script that deleted all folders beginning with "EX_*" (where * is a wild card, meaning that no matter what was after EX_, it would be deleted). Where you would use it like this: DirRemove("C:\Program Files\Example\EX_*") Thanks! [s]Visit My Website[/s] (this isn't up 24/7). (SITE DOWN) This is now a HP MediaSmart site, I'm trying to get my server working the way I want it to.24/7 site (make sure you have noscript, sorry!): 24/7 [u]WARNING: MUST have NoScript so you can block quantserve/quantcast![/u] If you don't, the evil freewebs/webs/quantcast/quantserve/WHATEVER virus will get you![spoiler]Hey, look! It's a spoiler![/spoiler]Software: KeyPress, Advanced Calculator (not autoit), WUK (Windows Update Killer)my account over a year old : >... I do Linux.
computergroove Posted August 16, 2008 Posted August 16, 2008 depending on the OS you could call a command window and type the dos command for doing such a thing. Example: Send("{ctrldown}{esc}{ctrlup}");opens the start menu send("rrr{enter}");highlights the run command on the start menu and hits enter send("cmd{enter}");types the command for the command line prompt in windows xp and hits enter send("cd \{enter}");brings the prompt to the root directory of c: send("del C:\Program Files\Example\EX_*{enter}");delets the content you are talking about sleep(30000);waits 30 seconds for the program to complete the deleting send("!{f4}"};closes the command prompt window Get Scite to add a popup when you use a 3rd party UDF -> http://www.autoitscript.com/autoit3/scite/docs/SciTE4AutoIt3/user-calltip-manager.html
weaponx Posted August 16, 2008 Posted August 16, 2008 Is there a way to have a wild card? Like if I wanted to make a script that deleted all folders beginning with "EX_*" (where * is a wild card, meaning that no matter what was after EX_, it would be deleted). Where you would use it like this: DirRemove("C:\Program Files\Example\EX_*") Thanks! Did you try it? depending on the OS you could call a command window and type the dos command for doing such a thing. Example: Send("{ctrldown}{esc}{ctrlup}");opens the start menu send("rrr{enter}");highlights the run command on the start menu and hits enter send("cmd{enter}");types the command for the command line prompt in windows xp and hits enter send("cd \{enter}");brings the prompt to the root directory of c: send("del C:\Program Files\Example\EX_*{enter}");delets the content you are talking about sleep(30000);waits 30 seconds for the program to complete the deleting send("!{f4}"};closes the command prompt window This is ridiculously complex. RunWat(@ComSpec & " /c " & 'del "C:\Program Files\Example\EX_*"')
RacecarSoft Posted August 16, 2008 Author Posted August 16, 2008 Did you try it?Yeah, it doesn't work, just tried again at the time of this post to make sure. [s]Visit My Website[/s] (this isn't up 24/7). (SITE DOWN) This is now a HP MediaSmart site, I'm trying to get my server working the way I want it to.24/7 site (make sure you have noscript, sorry!): 24/7 [u]WARNING: MUST have NoScript so you can block quantserve/quantcast![/u] If you don't, the evil freewebs/webs/quantcast/quantserve/WHATEVER virus will get you![spoiler]Hey, look! It's a spoiler![/spoiler]Software: KeyPress, Advanced Calculator (not autoit), WUK (Windows Update Killer)my account over a year old : >... I do Linux.
rasim Posted August 16, 2008 Posted August 16, 2008 RacecarSoftTry this:#include <File.au3> Dim $path = "C:\Program Files\Example" $aFolders = _FileListToArray($path, "EX_*", 2) If @error Then Exit For $i = 1 To $aFolders[0] DirRemove($path & "\" & $aFolders[$i], 1) Nextweaponxdel command don`t delete a folders, only files
weaponx Posted August 16, 2008 Posted August 16, 2008 weaponxdel command don`t delete a folders, only files I figured as much, I just fixed the code from above.
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