Announcement

Collapse
No announcement yet.

A script to Purge unused scripts

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    A script to Purge unused scripts

    This is a script which can be run either by reoccurring, manual or X10 triggered. Well it would be since it's a script.

    It checks the date that the scrips were last accessed and gives you the option, depending on your ini settings, to delete them from your script folder.

    It has a completely configurable ini file which also includes the option of saving a back up of the files it is going to remove.

    I think it's a wonderful script, the problem is, I have no idea how to access the last accessed date of a file under Windows XP, in fact I have no idea how to put this script together, although, had I the knowledge to access XP and retrieve the data I would give it a go.

    Any one like to take this on and write the script, or share how to access Windows?

    If it works, which it will, it could be extended to the whole computer, a bit like Rupp did with his backup EXE.

    Think, it could be your claim to fame.
    sigpic
    A founder member of "The HA Pioneer Group" otherwise known as the "Old farts club!"

    #2
    Gogs,
    The only draw back to this is if it is a script is delivered with HS and your delete it - it will cause the Microsoft installer to attempt to reinstall the deleted files.
    💁‍♂️ Support & Customer Service 🙋‍♂️ Sales Questions 🛒 Shop HomeSeer Products

    Comment


      #3
      Gogs,
      Jon's File grabber asp has a good example of using file attributes.

      http://board.homeseer.com/showthread...ile+attributes
      💁‍♂️ Support & Customer Service 🙋‍♂️ Sales Questions 🛒 Shop HomeSeer Products

      Comment


        #4
        I did a script/asp application back in 2002 that is in the script library that I think is called Upload Database. What it would do is an analysis of all the HS device and events and put the info into an Access database. It would also then drill down into the \Scripts and \HTML folders looking for uses of the device/event names and codes to correlate and produce asp pages where relationships could be viewed. It also has an Access form/subform setup to view interatively as well. It ran each night and kept a change log so I could see what changes I made in HS and the scripts each day. As my daily use of HS decreased I no longer had a need for this information and did not update the script over time. I'm describing it now for anyone else that may find something in it useful.

        Comment


          #5
          JUST DELETE ALL YOUR SCRIPTS AND CHECK YOU LOG FOR ERRORS.BAH HA Ha.....


          ~Bill

          Comment


            #6
            Originally posted by Bill Brower
            JUST DELETE ALL YOUR SCRIPTS AND CHECK YOU LOG FOR ERRORS.BAH HA Ha.....
            Yes Bill thats one way to do it, very quick as well for getting rid of unused scripts. And everything else for that matter.
            sigpic
            A founder member of "The HA Pioneer Group" otherwise known as the "Old farts club!"

            Comment


              #7
              Originally posted by Michael McSharry
              I did a script/asp application back in 2002 that is in the script library that I think is called Upload Database. What it would do is an analysis of all the HS device and events and put the info into an Access database. It would also then drill down into the \Scripts and \HTML folders looking for uses of the device/event names and codes to correlate and produce asp pages where relationships could be viewed. It also has an Access form/subform setup to view interatively as well. It ran each night and kept a change log so I could see what changes I made in HS and the scripts each day. As my daily use of HS decreased I no longer had a need for this information and did not update the script over time. I'm describing it now for anyone else that may find something in it useful.
              Now that sounds interesting.

              I did a quick search on "Upload Database" and it produced no results. I tried the current script library and the archieved one. I will try a more deep search latter on.

              Thanks for that.
              sigpic
              A founder member of "The HA Pioneer Group" otherwise known as the "Old farts club!"

              Comment


                #8
                Originally posted by Rupp
                Gogs,
                Jon's File grabber asp has a good example of using file attributes.

                http://board.homeseer.com/showthread...ile+attributes
                Rupp,

                Your point in your first post about deleting files that HS installed is a very valid one which I had not thought of. Thanks for the link I will have a look.
                sigpic
                A founder member of "The HA Pioneer Group" otherwise known as the "Old farts club!"

                Comment


                  #9
                  It is in the script library at http://board.homeseer.com/showthread.php?t=88478

                  Comment


                    #10
                    Originally posted by Michael McSharry
                    Thanks, found it, got it, and will play (try) it at the end of this week, if not sooner.
                    sigpic
                    A founder member of "The HA Pioneer Group" otherwise known as the "Old farts club!"

                    Comment


                      #11
                      I don't know if this will help get the ball rolling, but here's some code that will gather and announce the last time a file was accessed on Windows 2000. (not sure if it will work on XP)

                      Code:
                      sub main()
                      Dim fso
                      Set fso = CreateObject("Scripting.FileSystemObject")
                      hs.speak "Last Accessed Date: " & FormatDateTime(fso.GetFile("c:\folder\file.txt").DateLastAccessed)
                      end sub
                      The folder and file are obviously made up. Sadly, I can't take the credit for this coding format. Malarcy helped me out on something very similar to this a few days ago in this thread: http://forums.homeseer.com/showthread.php?t=115756

                      HTH

                      Comment


                        #12
                        Thanks for that snipit of code Malarcy. I'll play with that this weekend.
                        sigpic
                        A founder member of "The HA Pioneer Group" otherwise known as the "Old farts club!"

                        Comment


                          #13
                          Malarcy,

                          That code works perfectly.

                          Now to incorporate it into an event. I have pretty much got the idea how to do it except how to move files and delete them form a script. I could use a BAT file I suppose.

                          Anyone know how to move and delete from a script?
                          sigpic
                          A founder member of "The HA Pioneer Group" otherwise known as the "Old farts club!"

                          Comment

                          Working...
                          X