Ahmed97 Posted June 23, 2011 Share 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 Link to comment Share on other sites More sharing options...
Meerecat Posted June 23, 2011 Share 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. Link to comment Share on other sites More sharing options...
Ahmed97 Posted June 23, 2011 Author Share Posted June 23, 2011 windows xp sp2 Link to comment Share on other sites More sharing options...
martin Posted June 23, 2011 Share 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. Link to comment Share on other sites More sharing options...
Merrik Posted June 23, 2011 Share 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 Link to comment Share on other sites More sharing options...
Ahmed97 Posted June 23, 2011 Author Share 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 Link to comment Share on other sites More sharing options...
monoscout999 Posted June 23, 2011 Share Posted June 23, 2011 failed :S it says done but files still there xDwhat example? maybe admin rights have something to do.. -.- Link to comment Share on other sites More sharing options...
Ahmed97 Posted June 23, 2011 Author Share 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 !! Link to comment Share on other sites More sharing options...
Ahmed97 Posted June 23, 2011 Author Share Posted June 23, 2011 what example? maybe admin rights have something to do.. -.-im the admin ===============================Problem resolved Thanks all who tried to help Link to comment Share on other sites More sharing options...
Ahmed97 Posted June 23, 2011 Author Share 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 Link to comment Share on other sites More sharing options...
Ahmed97 Posted June 23, 2011 Author Share 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 Link to comment Share on other sites More sharing options...
JohnOne Posted June 23, 2011 Share 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. Link to comment Share on other sites More sharing options...
Ahmed97 Posted June 23, 2011 Author Share Posted June 23, 2011 ok sorry ( comments edited ! ) Link to comment Share on other sites More sharing options...
DaveYuhas Posted August 12, 2013 Share 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. Link to comment Share on other sites More sharing options...
kylomas Posted August 12, 2013 Share 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 Link to comment Share on other sites More sharing options...
FireFox Posted August 12, 2013 Share Posted August 12, 2013 (edited) I'm wondering how the hell they reply to old topics... Edited August 12, 2013 by FireFox Link to comment Share on other sites More sharing options...
JohnOne Posted August 12, 2013 Share 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. Link to comment Share on other sites More sharing options...
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