Prepare for your Next Interview
|
Welcome to the Geeks Talk forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact contact us. |
This is a discussion on script that deletes files older than 5 days within the VB.NET forums, part of the Software Development category; Hi, this may sound weird, but to some release problems with our sql server 2k i have to remove the transaction logs manually. In order for me to avoid this ...
|
|||||||
|
|||
|
script that deletes files older than 5 days
Hi, this may sound weird, but to some release problems with our sql server 2k i have to remove the transaction logs manually. In order for me to avoid this time consuming task i have written [or rather modified] the simple script that does it for me. My issue however is that, while i'm trying to schedule it as a job [on sql server], i'm getting a message that the script has created objects that are not being deleted [weird] should i remove the fso object at the end of my script? here is the code:
Code:
option explicit dim fso, dtwoweeksago dtwoweeksago = date() - 5 set fso = createobject("scripting.filesystemobject") dirwalk("g:\weekly tran\") dirwalk("g:\daily tran\") sub dirwalk(parmpath) dim osubdir, osubfolder, ofile, n on error resume next set osubfolder = fso.getfolder(parmpath) for each ofile in osubfolder.files if err.number <> 0 then err.clear elseif ofile.datelastmodified < dtwoweeksago then fso.deletefile ofile.path, true end if next for each osubdir in osubfolder.subfolders dirwalk osubdir.path next on error goto 0 end sub
|
| Sponsored Links |
![]() |
|
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Loadrunner script with attachment files | sai1234 | LoadRunner | 6 | 02-04-2009 03:28 PM |
| Showing older Java version | Geek_Guest | Unix/Linux | 0 | 09-09-2007 09:30 AM |
| how many days apart? | vmshenoy | Brainteasers | 3 | 01-17-2007 02:58 AM |
| How many 4Test Script files should be present in the Suit file S1. | JobHelper | SilkTest | 0 | 12-28-2006 06:03 AM |
| Howmany days.. | psuresh1982 | Brainteasers | 4 | 11-29-2006 01:52 AM |