I am working on a script to get the FilePath, Filename and the created date displayed for any file which is in a Folder whose name is MRV. Let me explain in detail :
I have a Directory which has hundreds of folders and they have subfolders. One subfolder is named MRV in each folder. Now, I need to recursively go into each folder, look for MRV folder and DIR the filenames along with its Create date. I can have the output stored in a text file or in a SQL table. I tried to use the DOS command :
FOR /D %%a IN (C:\Test*) DO Dir /T:C /b /s %%a\MRV*.txt>>C:\List.txt
This gives me the complete paths for e.g as below:
What I am looking for is something like :
C:\Test\ABC\MRV\63399862\mrv-abc-oth.txt 16/02/2010 14:32 PM
Can you suggest any way how the same can be done using SQL ?
asked Feb 16, 2010 at 03:08 AM in Default
It may be possible with SQL but not recommended as there are far better ways to do it. If you dont get DOS to complete the task then LogParser or PowerShell will be a safe bet, after that a vbscript solution. All of these are better at accessing the file system than SQL.
answered Feb 16, 2010 at 05:55 AM
You're using the /b switch which is suppressing output of the creation date.
answered Feb 16, 2010 at 04:25 AM