Jump to content
Sign in to follow this  
erikson

file delete question

Recommended Posts

erikson

how i can search in a folder for a specific file, and if i find it , delete it ?

Share this post


Link to post
Share on other sites
MHz

If you know the file name and where it is then just FileDelete(). If you want to step through the files with a wildcard name the FileFindFirstFile() and FileFindNextFile can help you there. Also using @ComSpec using it's Dir or Del command with StdOut can do it quick and easy. Depends on what your needs are exactly.

:shocked:

Edited by MHz

Share this post


Link to post
Share on other sites
erikson

the file is called config.cfg. and it exist in some dirs

the problem is that i don`t know exactly in witch folder are. (the parent folder is for example c:\home)

Share this post


Link to post
Share on other sites
MHz

If you want to delete any config.cfg files in c:\home and it's subdirs then use this

RunWait('"' & @ComSpec & '" /c Del /s/f/q config.cfg', 'c:\home')

/s does subdirs.... Use Del /? at a Command Prompt for further help.

:shocked:

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  

×