BleepingComputer.com: DOS Command

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

DOS Command dir

#1 User is offline   Nisha Haridas 

  • New Member
  • Find Topics
  • Group: Banned Spammer
  • Posts: 1
  • Joined: 25-November 10

  Posted 25 November 2010 - 05:40 AM

What is dir

#2 User is offline   Romeo29 

  • Learning To Bleep
  • PipPipPipPipPipPip
  • Find Topics
  • Group: BC Advisor
  • Posts: 2,834
  • Joined: 06-July 08
  • Gender:Not Telling
  • Location:127.0.0.1

Posted 25 November 2010 - 09:23 AM

Welcome to BleepingComputer Nisha :)

DIR command lists the contents of the a folder. If you give just DIR command without any parameters, then it will list the contents of the current folder. If you give the folder path like DIR C:\Windows then it will list the contents of that folder. How the contents are displayed and which contents are displayed, depends upon various switches like /P /E /A etc.

http://en.wikipedia.org/wiki/Dir_%28command%29
http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/dir.mspx

#3 User is offline   ronald110 

  • New Member
  • Pip
  • Find Topics
  • Group: Members
  • Posts: 3
  • Joined: 27-November 10

Posted 14 December 2010 - 02:21 AM

Thanks for the resource of DOS command.I need them for the batch file programming. :mellow:

#4 User is offline   Romeo29 

  • Learning To Bleep
  • PipPipPipPipPipPip
  • Find Topics
  • Group: BC Advisor
  • Posts: 2,834
  • Joined: 06-July 08
  • Gender:Not Telling
  • Location:127.0.0.1

Posted 14 December 2010 - 08:33 AM


#5 User is offline   stgurbuz 

  • New Member
  • Pip
  • Find Topics
  • Group: Members
  • Posts: 1
  • Joined: 27-December 10

Posted 27 December 2010 - 07:34 AM

View PostNisha Haridas, on 25 November 2010 - 05:40 AM, said:

What is dir

Hello,
I hope everything is OK.

I want "dir" latest date. For example in any directory there 5 files. Like below;

created date 12.27.2010 10:00 a.txt
created date 12.27.2010 11:00 b.txt
created date 10.27.2010 09:00 c.txt
created date 09.27.2010 10:00 d.txt
created date 09.27.2010 11:00 e.txt

and I want to list just specified date for example
created date 12.27.2010 a.txt
created date 12.27.2010 b.txt

only both of them.

How can I do? It is possible

#6 User is offline   Eyesee 

  • Bleepin Teck Shop
  • PipPipPipPipPipPip
  • Find Topics
  • Group: BC Advisor
  • Posts: 3,446
  • Joined: 15-July 06
  • Gender:Male
  • Location:In the middle of Kansas

Posted 28 December 2010 - 02:56 PM

Depend on the version of Windows. I am assuming XP here.
You cannot (at least as far as I know) restrict the dir command to a specific date range.
However you can have it sort the list with the most recent on top
The syntax would be
dir /o-d

Here is a link to all the switches for the dir command
In the beginning there was the command line.

#7 User is offline   rhoadesb 

  • Member
  • PipPip
  • Find Topics
  • Group: Members
  • Posts: 41
  • Joined: 14-June 10
  • Gender:Male
  • Location:Pennsylvania, USA

Posted 18 January 2011 - 12:44 AM

If you know basic programming, you can use Qbasic in conjunction with DOS's dir command to do what you want.

#8 User is offline   426hemi#10 

  • New Member
  • Pip
  • Find Topics
  • Group: Members
  • Posts: 5
  • Joined: 28-January 11

Posted 06 March 2011 - 09:44 AM

On a personal note I just wish I could get someone or something to teach me the ins and outs of MS-DOS or DOS or anything DOS so that I was able to work within the DOS environment I can't help but think give me a better understanding of computers because I am the only one in my household cares about the health of the machines that are used in this household I am asked to troubleshoot what I know very little to nothing about computing I cannot afford nor do I wish to spend $20,000 on education as difficult as it is to find I know that knowledge is here at my fingertips somewhere on the Internet but hasn't so far it has been very elusive I guess what I'm saying is please somebody point me in the right direction. thank you and have a nice day.

#9 User is offline   426hemi#10 

  • New Member
  • Pip
  • Find Topics
  • Group: Members
  • Posts: 5
  • Joined: 28-January 11

Posted 06 March 2011 - 09:52 AM

Let me just add to my first comment I am aware of there are books and other things to allow me to be self-taught but let me just say I suffer from certain limitations that would cause me to have to depart with monies that are already hard to come by anyway I don't believe for one minute that anything on the Internet especially in the way of education should cost more money than the initial charge for for the privilege of using Internet in the first place anything else outside of that I believe is highway robbery, robbery, robbery, the Internet was not meant to be exploited by big commercialism.

#10 User is offline   Romeo29 

  • Learning To Bleep
  • PipPipPipPipPipPip
  • Find Topics
  • Group: BC Advisor
  • Posts: 2,834
  • Joined: 06-July 08
  • Gender:Not Telling
  • Location:127.0.0.1

Posted 06 March 2011 - 11:39 AM

You can learn MS-DOS from the internet tutorials. But MS-DOS is now obsolete and nobody uses it. Everybody uses Windows, and the command prompt included inside Windows has many more features than the old MS-DOS. MS-DOS was an operating system in itself and the command prompt inside Windows is just one of the features of Windows operating system.

BleepingComputer has a tutorial : http://www.bleepingcomputer.com/tutorials/windows-command-prompt-introduction/

#11 User is offline   Eyesee 

  • Bleepin Teck Shop
  • PipPipPipPipPipPip
  • Find Topics
  • Group: BC Advisor
  • Posts: 3,446
  • Joined: 15-July 06
  • Gender:Male
  • Location:In the middle of Kansas

Posted 07 March 2011 - 02:10 PM

@426hemi#10

Many of us here are well versed in MSDOS.
We would be more than happy to answer any questions you may have about it.

May I suggest though that you start your own thread for such so that your posts do not get overlooked or burried.
In the beginning there was the command line.

#12 User is offline   dnthns87 

  • Member
  • PipPip
  • Find Topics
  • Group: Members
  • Posts: 27
  • Joined: 18-March 12

Posted 18 March 2012 - 11:19 AM

Easy enough to use set /p and for...


Try something like this?

@ECHO OFF
set /p in=-
for /f "tokens=1*" %%a in ('dir') do IF "%%a"=="%in%" (CLS&ECHO %B) ELSE ...



You could also use findstr.

This post has been edited by dnthns87: 18 March 2012 - 11:19 AM


Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users