Results 1 to 5 of 5

Thread: Dos Batch File Help

  1. #1
    www.evilmunky.com EvilMunky's Avatar
    Join Date
    Jul 2004
    Location
    www.evilmunky.com
    Posts
    1,396
    Thanks
    10
    Thanked
    6 times in 5 posts

    Dos Batch File Help

    Hi Guys,

    I figured i would ask in here as im not having much luck.

    Basically, i am writing a batch file script that for all intents and purposes is a clean up script (a little more complicated tho).

    What i need is to have a command line that will produce a list of files older than a given date, and to only show the name of the file without lots of eroneous crap.

    I cant seem to find anything or anyway of doing this.

    If anyone has any suggestsion i would appreciate it.

    It must be able to be run as a command line and produce a list of files within the criteria given.

    Thanks in advance

  2. #2
    Senior Member
    Join Date
    Aug 2003
    Posts
    351
    Thanks
    5
    Thanked
    9 times in 9 posts
    • nimbu's system
      • Motherboard:
      • M3N78-EMH
      • CPU:
      • AMD 4050e
      • Memory:
      • 4GB (2x2GB) Cosair XMS DDR2
      • Storage:
      • 30GB Samsung SSD : 250GB Seagate ES
      • Graphics card(s):
      • 9800GT
      • PSU:
      • Hyper Type R 550W Modular
      • Case:
      • Antec P180 Mini
    dir /b, Gives bare information ie file info

    dir /od sorts by date, oldest first

    So put it together, dir /b /od should give u the list ur after.

    Finally ">output.txt" dumps the output to a file called output.txt in the directory that the command is called from.

    so, dir /b /od >output.txt

    Running from my profile directory on this machine i get the following

    WINDOWS
    Start Menu
    .housecall
    Favorites
    Desktop
    My Documents
    output.txt


    Hope that helps
    Nimbu
    MAIN BOX: 4200+ @2.75 : Asus A8N-SLI Deluxe: XP120 + Papst: 2Gb Mushkin Redline PC4000: 512MB 7950GT: 2x36GB WD Raptors in RAID 0:WD 420GB : NEC DVDR/RW: All Wrapped up in a Antec P180



  3. #3
    Senior Member
    Join Date
    Aug 2003
    Posts
    351
    Thanks
    5
    Thanked
    9 times in 9 posts
    • nimbu's system
      • Motherboard:
      • M3N78-EMH
      • CPU:
      • AMD 4050e
      • Memory:
      • 4GB (2x2GB) Cosair XMS DDR2
      • Storage:
      • 30GB Samsung SSD : 250GB Seagate ES
      • Graphics card(s):
      • 9800GT
      • PSU:
      • Hyper Type R 550W Modular
      • Case:
      • Antec P180 Mini
    Also edit, an easier way maybe with VB for Dos, as that will let u combine your batch file and a few lines of code to parse it specifically the way you want.

    But its been too damn long since Ive done anything in VBdos..............................
    MAIN BOX: 4200+ @2.75 : Asus A8N-SLI Deluxe: XP120 + Papst: 2Gb Mushkin Redline PC4000: 512MB 7950GT: 2x36GB WD Raptors in RAID 0:WD 420GB : NEC DVDR/RW: All Wrapped up in a Antec P180



  4. #4
    www.evilmunky.com EvilMunky's Avatar
    Join Date
    Jul 2004
    Location
    www.evilmunky.com
    Posts
    1,396
    Thanks
    10
    Thanked
    6 times in 5 posts
    might hunt for vbdos.

    i know how to output it to file etc and order it, but its the fact i only wanna see files of a certain date...........or older than a certainamount of days - thats the hard bit

  5. #5
    Ex-MSFT Paul Adams's Avatar
    Join Date
    Jul 2003
    Location
    %systemroot%
    Posts
    1,926
    Thanks
    29
    Thanked
    77 times in 59 posts
    • Paul Adams's system
      • Motherboard:
      • Asus Maximus VIII
      • CPU:
      • Intel Core i7-6700K
      • Memory:
      • 16GB
      • Storage:
      • 2x250GB SSD / 500GB SSD / 2TB HDD
      • Graphics card(s):
      • nVidia GeForce GTX1080
      • Operating System:
      • Windows 10 x64 Pro
      • Monitor(s):
      • Philips 40" 4K
      • Internet:
      • 500Mbps fiber
    Found "DEL OLD v2.0":
    http://www.filelibrary.com/Contents/DOS/50/6.html

    This can be used with "test mode" and you can feed it a number of hours.
    e.g.
    "DEL_OLD *.txt 24:00 /t" will list all the .TXT files older than 24 hours


    There are probably better things to do it - TreeView or something if you want a GUI, or hunt Google for command-line utils.
    ~ I have CDO. It's like OCD except the letters are in alphabetical order, as they should be. ~
    PC: Win10 x64 | Asus Maximus VIII | Core i7-6700K | 16GB DDR3 | 2x250GB SSD | 500GB SSD | 2TB SATA-300 | GeForce GTX1080
    Camera: Canon 60D | Sigma 10-20/4.0-5.6 | Canon 100/2.8 | Tamron 18-270/3.5-6.3

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 63
    Last Post: 14-11-2011, 09:17 AM
  2. Bin File And Cue File Help!!!
    By bambie in forum Help! Quick Relief From Tech Headaches
    Replies: 7
    Last Post: 12-02-2005, 02:16 PM
  3. How do you backup?
    By Howard in forum PC Hardware and Components
    Replies: 48
    Last Post: 05-01-2005, 09:05 AM
  4. Manage downloaded webpages file and folder
    By Zathras in forum Software
    Replies: 0
    Last Post: 17-09-2003, 05:37 PM
  5. Replies: 0
    Last Post: 20-08-2003, 11:42 AM

Posting Permissions

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