Alpha Video Training
Results 1 to 5 of 5

Thread: Emptying a windows folder

  1. #1
    Member
    Real Name
    Nick Oldfield
    Join Date
    Aug 2008
    Posts
    344

    Default Emptying a windows folder

    How can I empty a windows folder? I thought I could probably delete the folder and then create it again but dir_remove will only work if the folder is empty

  2. #2
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    25,119

    Default Re: Emptying a windows folder

    file_list = filefind.get_recurse("your_directory_name","*.*")'no trailing backslash
    for each foo in file_list
    file.remove(foo.value)
    next

    your_directory_name should of course be the complete drive and path specification.
    Last edited by Stan Mathews; 03-07-2014 at 04:26 PM.
    There can be only one.

  3. #3
    Member
    Real Name
    Nick Oldfield
    Join Date
    Aug 2008
    Posts
    344

    Default Re: Emptying a windows folder

    Thanks Stan. I had hoped to find a way that did not take so much run time!

  4. #4
    "Certified" Alphaholic Ray in Capetown's Avatar
    Real Name
    Ray Hendler
    Join Date
    Jan 2009
    Location
    South Africa
    Posts
    2,036

    Default Re: Emptying a windows folder

    Create a batch file ;
    In this example in c:\ , called delcha.bat
    containing the line
    Code:
    del c:\chacom\redundant\*.*
    When you run this command in A5 all files in redundant folder will be deleted
    Code:
    delbatfile="c:\delcha.bat"
    sys_open(delbatfile)

  5. #5
    Member
    Real Name
    Nick Oldfield
    Join Date
    Aug 2008
    Posts
    344

    Default Re: Emptying a windows folder

    Quote Originally Posted by Ray in Capetown View Post
    Create a batch file ;
    In this example in c:\ , called delcha.bat
    containing the line
    Code:
    del c:\chacom\redundant\*.*
    When you run this command in A5 all files in redundant folder will be deleted
    Code:
    delbatfile="c:\delcha.bat"
    sys_open(delbatfile)
    ...very creative, thanks I will try it..

Similar Threads

  1. Can I open a folder with Windows Explorer ?
    By Steviev in forum Alpha Five Version 10 - Desktop Applications
    Replies: 18
    Last Post: 01-19-2013, 02:27 AM
  2. Windows Folder - off subject
    By Peter.Greulich in forum Alpha Five Version 10 - Desktop Applications
    Replies: 24
    Last Post: 03-09-2011, 11:53 PM
  3. Function for select folder using windows get folder dialog?
    By jjfcpa in forum Alpha Five Version 9 - Desktop Applications
    Replies: 1
    Last Post: 08-12-2008, 06:49 PM
  4. Opening a folder in windows
    By DORaymond in forum Alpha Five Version 4
    Replies: 3
    Last Post: 01-04-2008, 04:50 PM
  5. Find name of Windows folder
    By Bill Warner in forum Alpha Five Version 5
    Replies: 34
    Last Post: 11-21-2004, 04:18 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •