Nandha Kumar B
asked on
use dir command
how to use dir command to search for files that ran last one hour ?
see the below command that search for last modified xml file in folder with the date
dir /b /a-d /o-d "%BaseDir%\*.xml" 2^>NUL
i need search for one hour file so need the command to search for time
see the below command that search for last modified xml file in folder with the date
dir /b /a-d /o-d "%BaseDir%\*.xml" 2^>NUL
i need search for one hour file so need the command to search for time
First of all: Please define "ran last".. and what file system. And some context.
Assuming that it's NTFS: You have only the LastAccessed timestamp, but this don't tell you who accessed it. So a AV check may changes this.
Assuming that it's NTFS: You have only the LastAccessed timestamp, but this don't tell you who accessed it. So a AV check may changes this.
ASKER
Hi john,
i want to check word "error" in xml files under a path log(C:\logs\)
under that log there are many xml and many files will be created every hour and then.
i need to check for error in particular time in the files created for last one hour.
i want to check word "error" in xml files under a path log(C:\logs\)
under that log there are many xml and many files will be created every hour and then.
i need to check for error in particular time in the files created for last one hour.
I suggest you try getting the list of file with the Powershell command. DIR does not do this.
ASKER
Thank you john for your help.
could you help me with powershell?
could you help me with powershell?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
@Nandha Kumar B - Thank you and good luck with determining recent files.
OR:
You can use Powershell to do this:
https://social.technet.microsoft.com/Forums/ie/en-US/a7630d96-eaac-4879-9ca2-d34e70b3bb73/powershell-script-to-check-if-files-are-created-within-last-hour?forum=ITCG