Jump to content

Recommended Posts

Posted

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

Posted

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.

Posted

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.
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
Posted

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 !!
Posted

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

im the admin :huh2:

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

Problem resolved Thanks all who tried to help ;)

Posted (edited)

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

deleting txt files PROBLEM RESOLVED !!!!

Edited by TheMaster
  • 2 years later...
Posted

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.

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

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
×
×
  • Create New...