Dir Cmd.

B

BaKaR

Hi.

Using: dir /s c:\ | find /i "some.file"
Ok, the result is positive.
But! how to get a Path to that file ? Dir cant reproduce it .. ?

Example:

* C:\>dir /s c:\ | find /i "winlogon.log"
26.02.2004 11:44 721 winlogon.log.lnk

So, i would like the: PATH/winlogon.log.lnk


Thank You.
 
P

Phil Robyn [MVP]

BaKaR said:
Hi.

Using: dir /s c:\ | find /i "some.file"
Ok, the result is positive.
But! how to get a Path to that file ? Dir cant reproduce it .. ?

Example:

* C:\>dir /s c:\ | find /i "winlogon.log"
26.02.2004 11:44 721 winlogon.log.lnk

So, i would like the: PATH/winlogon.log.lnk


Thank You.
For just the path\filename:

dir /s /b c:\ | find /i "winlogon.log"

For the file date, time, size, path\filename:

for /f %a in ('dir /s /b c:\ ^| find /i "winlogon.log"') do @echo %~ta %~za %~fa

- - - - - - - - - - begin screen capture Win2000 - - - - - - - - - -
c:\cmd>dir /s /b c:\ | find /i "winlog"
c:\I386\WINLOGON.EX_
c:\WINNT\$NtUninstallKB824141$\winlogon.exe
c:\WINNT\$NtUninstallQ328310$\winlogon.exe
c:\WINNT\$NtUninstallQ329115$\winlogon.exe
c:\WINNT\security\logs\winlogon.log
c:\WINNT\security\logs\winlogon.old
c:\WINNT\ServicePackFiles\i386\winlogon.exe
c:\WINNT\system32\WINLOGON.EXE
c:\WINNT\system32\dllcache\WINLOGON.EXE

c:\cmd>for /f %a in ('dir /s /b c:\ ^| find /i "winlog"') do @echo %~ta %~za %~fa
12/07/99 04:00a 75521 c:\I386\WINLOGON.EX_
06/19/03 11:05a 181008 c:\WINNT\$NtUninstallKB824141$\winlogon.exe
08/15/02 06:30a 179472 c:\WINNT\$NtUninstallQ328310$\winlogon.exe
07/22/02 11:05a 178960 c:\WINNT\$NtUninstallQ329115$\winlogon.exe
02/27/04 01:26a 44718 c:\WINNT\security\logs\winlogon.log
02/24/04 10:54p 1059550 c:\WINNT\security\logs\winlogon.old
06/19/03 11:05a 181008 c:\WINNT\ServicePackFiles\i386\winlogon.exe
07/17/03 09:20a 182032 c:\WINNT\system32\WINLOGON.EXE
07/17/03 09:20a 182032 c:\WINNT\system32\dllcache\WINLOGON.EXE
- - - - - - - - - - end screen capture Win2000 - - - - - - - - - -
 
B

Bob I

Maybe I missed part of the question but

Why not ditch the "c:\ | find /i" part of this?
 
B

BaKaR

Ya, sorry, i missed the /b switch cauze i tryed regular dir /s /b and did get only file names, didnt tryed it in the dir /s /b c:\ |
find /i "winlogon" form, tought i did, but not.

Thank You All!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top