FN-GM Posted December 23, 2007 Posted December 23, 2007 Hi how would I produce a script that would delete all .txt & .log files from a particular location please? Thanks
mattx Posted December 23, 2007 Posted December 23, 2007 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...
ITWombat Posted December 23, 2007 Posted December 23, 2007 In VBS you would have to check all the files of a folder to see if the extension was txt or log Something like: For Each File in Folder.Files if UCASE(File.Extension) = "TXT" or UCASE(File.Extension)="LOG" File.delete endif Next It'd probably easier to do it as a batch file.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now