Kaseya Community

Deleting files in a folder Script

  • Hi guys,

    New to this, need help in writing a simple and easy script for deleting some files in a folder on a daily basis.
    One of our programs generates an "*.LCK" file in the folder "d:\program\acct"

    I need to delete on a daily basis all the files with extension "LCK" from that folder. Dont want to delete the folder as there are other files in there that should not be deleted.

    Dont want to accidentally delete any important files in this folder, so i need some experts to help me. Smile

    Thanks in advance.

    Legacy Forum Name: Deleting files in a folder Script,
    Legacy Posted By Username: jgtan97
  • I would suggest that you write a DOS-batch file, which deletes *.lck in the desired folder. Create a Kaseta script to run that batch file (Execute shell command), and schedule that script to run each day/night at the desired time.

    Hope this helps you.

    Lloyd

    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: lwolf
  • Am I right in assuming this is a paradox based application?

    We've had a similar issue, we routinely use a bat file to clear out the .lck files. Smile

    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: LANWorx
  • Here ya go..

    Script Name: Delete all LCK files
    Script Description:

    IF True
    THEN
    Execute Shell Command
    Parameter 1 : del d:\program\acct\*.lck /f /q
    Parameter 2 : 1
    OS Type : 0
    ELSE


    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: XeviouS