Ahmed97 1 Posted June 23, 2011 hi, i wanna make a script that delete " *.txt " files but it's fail :Ssee the script $Del = FileDelete("C:\test 1\*.txt") if $del = 1 then MsgBox(0, "", "done") Else MsgBox(0, "", "fail") EndIfbut when i change the folder name to " Test " Without space and 1 it work so why the command dosen't working with folder name spaces ?sorry for bad english :S Share this post Link to post Share on other sites
Meerecat 0 Posted June 23, 2011 hi, i wanna make a script that delete " *.txt " files but it's fail :S see the script $Del = FileDelete("C:\test 1\*.txt") if $del = 1 then MsgBox(0, "", "done") Else MsgBox(0, "", "fail") EndIf but when i change the folder name to " Test " Without space and 1 it work so why the command dosen't working with folder name spaces ? sorry for bad english :S What version of Windows do you have? I ran your script with 'test 1' as the folder name and it worked for me. Lack of planning on your part does not constitute an emergency on my part.-The biggest idiot can ask questions the smartest man cannot answer. Share this post Link to post Share on other sites
martin 85 Posted June 23, 2011 What version of Windows do you have? I ran your script with 'test 1' as the folder name and it worked for me. It didn't work for me so I would agree that it's a bug. I'm using AutoIt production 3.3.6.1 and I tried on XP only. I would be surprised if the Windows version made a difference. However, if you try it in the Beta version it works so it's a bug which has already been fixed. This worked for me in the production version. FileChangeDir("C:\test 1\") $Del = FileDelete("*.txt") if $del = 1 then MsgBox(0, "", "done") Else MsgBox(0, "", "fail") EndIf Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Share this post Link to post Share on other sites
Merrik 0 Posted June 23, 2011 You could try this: $Del = RunWait(@ComSpec & " /c " & "Del C:\test 1\*.txt") if $del = 1 then MsgBox(0, "", "done") Else MsgBox(0, "", "fail") EndIf Share this post Link to post Share on other sites
Ahmed97 1 Posted June 23, 2011 (edited) You could try this: [ autoIt ] ( Popup ) $Del = RunWait(@ComSpec & " /c " & "Del C:\test 1\*.txt") if $del = 1 then MsgBox(0, "", "done") Else MsgBox(0, "", "fail") EndIf failed :S it says done but files still there xD Edited June 23, 2011 by TheMaster Share this post Link to post Share on other sites
monoscout999 10 Posted June 23, 2011 failed :S it says done but files still there xDwhat example? maybe admin rights have something to do.. -.- Share this post Link to post Share on other sites
Ahmed97 1 Posted June 23, 2011 It didn't work for me so I would agree that it's a bug. I'm using AutoIt production 3.3.6.1 and I tried on XP only. I would be surprised if the Windows version made a difference. However, if you try it in the Beta version it works so it's a bug which has already been fixed. This worked for me in the production version. FileChangeDir("C:\test 1\") $Del = FileDelete("*.txt") if $del = 1 then MsgBox(0, "", "done") Else MsgBox(0, "", "fail") EndIf it's working thankss !! Share this post Link to post Share on other sites
Ahmed97 1 Posted June 23, 2011 what example? maybe admin rights have something to do.. -.-im the admin ===============================Problem resolved Thanks all who tried to help Share this post Link to post Share on other sites
Ahmed97 1 Posted June 23, 2011 (edited) it's somtime working and sometime no in new beta version hope this get fixed Edited June 23, 2011 by TheMaster Share this post Link to post Share on other sites
Ahmed97 1 Posted June 23, 2011 (edited) it dont delete the Read only files Thats the bug !!!!---------------------------------------- deleting txt files PROBLEM RESOLVED !!!! Edited June 23, 2011 by TheMaster Share this post Link to post Share on other sites
JohnOne 1,603 Posted June 23, 2011 it's somtime working and sometime no in new beta versionhope this get fixedBuddy, writing in bold as you do, will be considered shouting as though its CAPS LOCK.Nobody will answer your questions any quicker, in fact some will just ignore them. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Share this post Link to post Share on other sites
Ahmed97 1 Posted June 23, 2011 ok sorry ( comments edited ! ) Share this post Link to post Share on other sites
DaveYuhas 0 Posted August 12, 2013 it's working thankss !! FileDelete() would not delete any of the files in the C:UsersDaveAppDataLocalMicrosoftWindowsTemporary Internet Files dir (even after setting attrib to normal), but deleted files in other dirs. So perhaps the question should be: why is FileDelete() protecting some files but not others? Windows 7, btw. Share this post Link to post Share on other sites
kylomas 416 Posted August 12, 2013 (edited) DaveYuhas, Welcome to the Forum! Please note the date of the thread that you are replying to. kylomas Edited August 12, 2013 by kylomas Forum Rules Procedure for posting code "I like pigs. Dogs look up to us. Cats look down on us. Pigs treat us as equals." - Sir Winston Churchill Share this post Link to post Share on other sites
FireFox 260 Posted August 12, 2013 (edited) I'm wondering how the hell they reply to old topics... Edited August 12, 2013 by FireFox OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDFMy Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme makerMy Examples : Capture tool | IP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewerMy Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control Share this post Link to post Share on other sites
JohnOne 1,603 Posted August 12, 2013 It's simple, people are encouraged to search the forum. When they do and reply they're told not to Most other sites want you to. Ambiguity. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Share this post Link to post Share on other sites