Sign in to follow this  
Followers 0
Ahmed97

FileDelete() bug

17 posts in this topic

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

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

windows xp sp2

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

#6 ·  Posted (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 by TheMaster

Share this post


Link to post
Share on other sites

failed :S it says done but files still there xD

what example? maybe admin rights have something to do.. -.-

Share this post


Link to post
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 !!

Share this post


Link to post
Share on other sites

what example? maybe admin rights have something to do.. -.-

im the admin :huh2:

===============================

Problem resolved Thanks all who tried to help ;)

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

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

hope this get fixed

Edited by TheMaster

Share this post


Link to post
Share on other sites

#11 ·  Posted (edited)

it dont delete the Read only files :huh2: Thats the bug !!!!----------------------------------------

deleting txt files PROBLEM RESOLVED !!!!

Edited by TheMaster

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

ok sorry ( comments edited ! )

Share this post


Link to post
Share on other sites

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

#15 ·  Posted (edited)

DaveYuhas,

Welcome to the Forum!

Please note the date of the thread that you are replying to.

 

kylomas

Edited 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

#16 ·  Posted (edited)

I'm wondering how the hell they reply to old topics...

Edited 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_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My 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

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
Sign in to follow this  
Followers 0