Jump to content


 


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Photo

Command: Using Date Switch W/ Dir?


  • Please log in to reply
4 replies to this topic

#1 tristanolas

tristanolas

  • Members
  • 7 posts
  • OFFLINE
  •  
  • Local time:05:06 AM

Posted 17 December 2006 - 02:44 PM

I can't find any info from online guides on simply:
list all *.txt files created on/after a given date
for example, it doesn't seem you can use the date switch w/ dir like:
dir C:\*.txt /s /d:12-17-2006

any input is appreciated.

BC AdBot (Login to Remove)

 


m

#2 usasma

usasma

    Still visually handicapped (avatar is memory developed by my Dad


  • BSOD Kernel Dump Expert
  • 25,073 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Southeastern CT, USA
  • Local time:05:06 AM

Posted 17 December 2006 - 06:39 PM

It doesn't appear that you can do this - although the /T or /O switch should sort them in dated order - so it'll be easier to pick them out.

Type dir /? at the command prompt to see the syntax.
My browser caused a flood of traffic, sio my IP address was banned. Hope to fix it soon. Will get back to posting as soon as Im able.

- John  (my website: http://www.carrona.org/ )**If you need a more detailed explanation, please ask for it. I have the Knack. **  If I haven't replied in 48 hours, please send me a message. My eye problems have recently increased and I'm having difficult reading posts. (23 Nov 2017)FYI - I am completely blind in the right eye and ~30% blind in the left eye.<p>If the eye problems get worse suddenly, I may not be able to respond.If that's the case and help is needed, please PM a staff member for assistance.

#3 tristanolas

tristanolas
  • Topic Starter

  • Members
  • 7 posts
  • OFFLINE
  •  
  • Local time:05:06 AM

Posted 17 December 2006 - 07:19 PM

I'm using /S because want to search the entire drive, but I don't want to sort results by folder
dir C:\*.txt /s /T:C sorts it by folder, & then by time regardless of the order I write the switches.
dir C:\*.txt /s /O:D does same
Any way to sort by date or time?

Also when doing searches through an entire drive like this, it would be helpful to be able to list only the first few items. The only switch I see for this is the /P to pause after each screenful. Is there a way to EXIT after you get the info you're looking for?

Edited by tristanolas, 17 December 2006 - 08:03 PM.


#4 tos226

tos226

    BleepIN--BleepOUT


  • Members
  • 1,568 posts
  • OFFLINE
  •  
  • Gender:Female
  • Location:LocalHost
  • Local time:05:06 AM

Posted 17 December 2006 - 09:52 PM

Instead of the dir command, for what you want, I think SEARCH will do the job.
In Explorer select C: then hit the search button, then All files and folders, type in *.txt in the first box.
Now scroll down for more options, click When was it modified, expand the window vertically some more, click Specify dates and the rest will be obvious, I hope :thumbsup:

If dir is your preferred way, then the alternative, without the need to use |P(ause) or |More is write the list to a file
dir c:\*.txt /s /od /on > c:\MyTxtDir.txt
and if you want to append some other lines, then insted of > write >> to a file
dir c:\*.doc /s /od /on >> c:\MyTxtDir.txt

The list will be separated by folders. If you want to get rid of folders, the only way I can suggest at this time is take the list to Word or Excel and do some massive find and replace to get rid of all the folder names. In excel you can filter out lines which aren't file names.

Edited by tos226, 17 December 2006 - 10:08 PM.


#5 tristanolas

tristanolas
  • Topic Starter

  • Members
  • 7 posts
  • OFFLINE
  •  
  • Local time:05:06 AM

Posted 18 December 2006 - 05:56 PM

Thanks, I thought it would be possible in 1 or 2 steps, but since it's not Window's search would probably be more appropriate... only I've had problems with it which I posted in a new topic

Edited by tristanolas, 18 December 2006 - 09:02 PM.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users