Sign in to follow this  
Followers 0
Shiro

delete a file without knowing the folder name

2 posts in this topic

hello

i have some files in a directory on desktop.

c:\Documents and Settings\Shiro\Desktop\Unknown_Folder\ (Files in this directory)

but the problem is that i know files names but not the directory name.

i want to delete 2 files in a directory on desktop.

File names are "Old1.xls" & "old2.xls"

like this

c:\Documents and Settings\Shiro\Desktop\Unknown_Folder\Old1.xls

c:\Documents and Settings\Shiro\Desktop\Unknown_Folder\Old2.xls

how can i do it?


Share this post


Link to post
Share on other sites



#Include <File.au3>

$Dir = _FileListToArray(@DesktopDir, '*', 2)
If Not @error Then
    For $i = 1 To $Dir[0]
        For $j = 1 To 2
;           FileDelete(@DesktopDir & '\' & $Dirs[$i] & '\Old' & $j & '.xls')
        Next
    Next
EndIf

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