Discussion:
DIR command
(too old to reply)
Leon
2010-03-12 13:27:12 UTC
Permalink
Hi


A very very simple thing - but i'm stuuuucked

I want to make a filelist with the dir command without diskinfo as
header
the very first line in the outputfile

c:\mydir> dir > myfile.txt
myfile.txt 12-03-2010 13:53

The

how do I do that?
Pegasus [MVP]
2010-03-12 13:56:12 UTC
Permalink
Post by Leon
Hi
A very very simple thing - but i'm stuuuucked
I want to make a filelist with the dir command without diskinfo as
header
the very first line in the outputfile
c:\mydir> dir > myfile.txt
myfile.txt 12-03-2010 13:53
The
how do I do that?
Perhaps like so:
dir /b
or like so:
dir | find "/"
or like so:
dir | find "/" | find /i /v ">"

The command
dir /?
will show you the many switches available for the dir command.
Leon
2010-03-12 22:36:53 UTC
Permalink
Hi

That works fine - making a file list.
My goal is to find out which file is the newest. Thought of taking out
info from the filelist in an array looping through it and find newest
file. Via vbs.

Now I've come to that idea that it somehow via dos commands to find
newest file.
searching after filenames matching specific patterns

Is that possible?

Cheers
Post by Leon
Hi
A very very simple thing - but i'm stuuuucked
I want to make a filelist with the dir command without diskinfo as
header
the very first line in the outputfile
c:\mydir> dir > myfile.txt
myfile.txt       12-03-2010 13:53
The
how do I do that?
dir  /b
dir | find "/"
dir | find "/" | find /i /v ">"
The command
dir /?
will show you the many switches available for the dir command.
Pegasus [MVP]
2010-03-12 23:17:21 UTC
Permalink
Did you notice my recommendation of running the command

dir /?

It will show you how to sort your files in any order you wish. And since you
mention VBS - I noticed that you're posting much the same question in a VB
Script newsgroup. Not a good idea - it leads to duplication of effort. Use
cross-posting instead: http://www.blakjak.demon.co.uk/mul_crss.htm.
Post by Leon
Hi
That works fine - making a file list.
My goal is to find out which file is the newest. Thought of taking out
info from the filelist in an array looping through it and find newest
file. Via vbs.
Now I've come to that idea that it somehow via dos commands to find
newest file.
searching after filenames matching specific patterns
Is that possible?
Cheers
Post by Pegasus [MVP]
Post by Leon
Hi
A very very simple thing - but i'm stuuuucked
I want to make a filelist with the dir command without diskinfo as
header
the very first line in the outputfile
c:\mydir> dir > myfile.txt
myfile.txt 12-03-2010 13:53
The
how do I do that?
dir /b
dir | find "/"
dir | find "/" | find /i /v ">"
The command
dir /?
will show you the many switches available for the dir command.
Leon
2010-03-12 23:53:35 UTC
Permalink
Hi Pegasus

I know this is another group.
Why? hmm ... First I asked if this was right group - - couldnt find a
DOS group when searching. sorry maybe Im blind.. next I don't know
which method is the best (fastest) to get the timestamp out of
filelists.
So therefor I want to try with DOS batch commands.. And here I am not
well to deep in knowledge.
So... :-)

And yes - I tried ls -help and dir /?
If that could give me the answer I was not here.
Post by Pegasus [MVP]
Did you notice my recommendation of running the command
dir /?
It will show you how to sort your files in any order you wish. And since you
mention VBS - I noticed that you're posting much the same question in a VB
Script newsgroup. Not a good idea - it leads to duplication of effort. Use
cross-posting instead:http://www.blakjak.demon.co.uk/mul_crss.htm.
Post by Leon
Hi
That works fine - making a file list.
My goal is to find out which file is the newest. Thought of taking out
info from the filelist in an array looping through it and find newest
file. Via vbs.
Now I've come to that idea that it somehow via dos commands to find
newest file.
searching after filenames matching specific patterns
Is that possible?
Cheers
Post by Leon
Hi
A very very simple thing - but i'm stuuuucked
I want to make a filelist with the dir command without diskinfo as
header
the very first line in the outputfile
c:\mydir> dir > myfile.txt
myfile.txt       12-03-2010 13:53
The
how do I do that?
dir  /b
dir | find "/"
dir | find "/" | find /i /v ">"
The command
dir /?
will show you the many switches available for the dir command.- Skjul tekst i anførselstegn -
- Vis tekst i anførselstegn -
Loading...