[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

How to list files in a folder - find all files modified on a single date AND owned by FRED

Posted on 2014-04-09
5
Medium Priority
?
789 Views
Last Modified: 2014-04-10
Does anyone know of a tool, ideally command line that will list files in a folder and subfolders that are modified on 1st April 2014, and owner is FRED.

Command line tool would be useful because I need results in a txt or CSV file

Many thanks for help
String,
0
Comment
Question by:TreadStone_IT
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 27

Accepted Solution

by:
MacroShadow earned 2000 total points
ID: 39990922
Try running this VBScript, it will create a tab delimited text file showing different file attributes:
Dim StrFolder
StrFolder = "C:\Users\MacroShadow\Test\" ' Doesn't care if UNC has terminating backslash or not
GetFileAttributes (StrFolder)

Private Sub GetFileAttributes(StrFolder)
    Dim objShell, objFolder, objFSO, strFileName, objFile, strDisplayText, i
    Set objFSO = CreateObject("Scripting.FileSystemObject")
    Set objFile = objFSO.CreateTextFile("C:\Users\MacroShadow\Test\output.txt", True)
    Set objShell = CreateObject ("Shell.Application")
    Set objFolder = objShell.Namespace(StrFolder)
    Dim arrHeaders(13)
    For i = 0 To 13
        arrHeaders(i) = objFolder.GetDetailsOf(objFolder.Items, i)
    Next
    For Each strFileName In objFolder.Items
        strDisplayText = ""
        If objFolder.GetDetailsOf(strFileName, 3) = #01/04/2014# And objFolder.GetDetailsOf(strFileName, 10)="Fred" Then
	        ' Comment out any attributes you don't want
	        strDisplayText = arrHeaders(0) & ": " & objFolder.GetDetailsOf(strFileName, 0)                                          'File Name
	        strDisplayText = strDisplayText & vbTab & arrHeaders(1) & ": " & objFolder.GetDetailsOf(strFileName, 1)     'File Size
	        strDisplayText = strDisplayText & vbTab & arrHeaders(2) & ": " & objFolder.GetDetailsOf(strFileName, 2)     'Item Type
	        strDisplayText = strDisplayText & vbTab & arrHeaders(3) & ": " & objFolder.GetDetailsOf(strFileName, 3)     'Date Modified
	        strDisplayText = strDisplayText & vbTab & arrHeaders(4) & ": " & objFolder.GetDetailsOf(strFileName, 4)     'Date Created
	        strDisplayText = strDisplayText & vbTab & arrHeaders(5) & ": " & objFolder.GetDetailsOf(strFileName, 5)     'Date Accessed
	        strDisplayText = strDisplayText & vbTab & arrHeaders(6) & ": " & objFolder.GetDetailsOf(strFileName, 6)     'Attributes
	        strDisplayText = strDisplayText & vbTab & arrHeaders(7) & ": " & objFolder.GetDetailsOf(strFileName, 7)     'Offline Status
	        strDisplayText = strDisplayText & vbTab & arrHeaders(8) & ": " & objFolder.GetDetailsOf(strFileName, 8)     'Offline Availability
	        strDisplayText = strDisplayText & vbTab & arrHeaders(9) & ": " & objFolder.GetDetailsOf(strFileName, 9)     'Perceived type
	        strDisplayText = strDisplayText & vbTab & arrHeaders(10) & ": " & objFolder.GetDetailsOf(strFileName, 10)  'Owner
	        strDisplayText = strDisplayText & vbTab & arrHeaders(11) & ": " & objFolder.GetDetailsOf(strFileName, 11)  'Kind
	        strDisplayText = strDisplayText & vbTab & arrHeaders(12) & ": " & objFolder.GetDetailsOf(strFileName, 12)  'Date Taken
	        strDisplayText = strDisplayText & vbTab & arrHeaders(13) & ": " & objFolder.GetDetailsOf(strFileName, 13)  'Contributing Artists
	        objFile.WriteLine strDisplayText
        End if
    Next
End Sub

Open in new window


Don't forget to change the paths on lines 2 and 8 to reflect your details.
0
 
LVL 35

Expert Comment

by:ste5an
ID: 39991115
There are no owners in MS DOS..

Using the Cmd Shell: FORFILES /D to get the files and DIR /Q or CACLS to get the owner.
0
 
LVL 58

Expert Comment

by:Bill Prew
ID: 39991877
Have you tried DIR /Q to see if it shows the owner info you are looking for?  If these are files on a network share it may.  If it does, then the rest could be done in a DOS bat script.

~bp
0
 

Author Comment

by:TreadStone_IT
ID: 39992975
Thanks everyone who read\responded to my question. The DIR /q gave me the info I needed but not in a format I could easily use.
The VB script gave me a csv file that I could manipulate.
Many thanks again
Have a great weekend
String
0
 

Author Closing Comment

by:TreadStone_IT
ID: 39992976
Thanks a bunch!!!
0

Featured Post

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article helps those who get the 0xc004d307 error when trying to rearm (reset the license) Office 2013 in a Virtual Desktop Infrastructure (VDI) and/or those trying to prep the master image for Microsoft Key Management (KMS) activation. (i.e.- C…
Compliance and data security require steps be taken to prevent unauthorized users from copying data.  Here's one method to prevent data theft via USB drives (and writable optical media).
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles to another domain controller. Log onto the new domain controller with a user account t…
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question