Jump to content

FileDelete() bug


Recommended Posts

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

Link to comment
Share on other sites

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

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

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 by TheMaster
Link to comment
Share on other sites

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

it's somtime working and sometime no :huh2: in new beta version

hope this get fixed

Buddy, 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

  • 2 years later...

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

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
 Share

  • Recently Browsing   0 members

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