Hi how would I produce a script that would delete all .txt & .log files from a particular location please?
Thanks

Hi how would I produce a script that would delete all .txt & .log files from a particular location please?
Thanks
Same as before - use VB script / AutoIT, or batch commands, type in Del /? on a command line to find out more.
If the txt and log files are all over the place then a simpe dir *.txt or dir *.log and pipe them to a file - eg:
dir*.txt /s>c:\textfiles.txt
Open up the text file in excel, stick in del on every line [ after moving the cells to the right ] - save it as a cmd file and run it and bob's your uncle.....
I would suggest you also look at powershell...
In VBS you would have to check all the files of a folder to see if the extension was txt or log
Something like:
It'd probably easier to do it as a batch file.Code:For Each File in Folder.Files if UCASE(File.Extension) = "TXT" or UCASE(File.Extension)="LOG" File.delete endif Next

Cheers guys!
There are currently 1 users browsing this thread. (0 members and 1 guests)