Search found 178 matches

by atfon
09 Oct 2017 13:02
Forum: DOS Batch Forum
Topic: Recursive Searching Across Directories & Date Sorting
Replies: 26
Views: 24101

Re: Recursive Searching Across Directories & Date Sorting

You need to compromise Understood. For what it's worth, I also tested this successfully on a system that did not have Administrative rights automatically invoked for the command line: for /f "tokens=*" %%a in ('robocopy "\." "\." *.txt /l /s /is /ts /ndl /njh /njs /nc ...
by atfon
09 Oct 2017 11:44
Forum: DOS Batch Forum
Topic: Recursive Searching Across Directories & Date Sorting
Replies: 26
Views: 24101

Re: Recursive Searching Across Directories & Date Sorting

I was able to get Compo's WMIC script to work, so that is a possibility. It just does not provide the date in as readable a format as the robocopy option. I will do some further experimentation to see which is the most viable option for the environments involved.
by atfon
09 Oct 2017 11:30
Forum: DOS Batch Forum
Topic: Recursive Searching Across Directories & Date Sorting
Replies: 26
Views: 24101

Re: Recursive Searching Across Directories & Date Sorting

According to this site, running WMIC requires Administrative rights:

https://ss64.com/nt/wmic.html

I attempted your WMIC command on a Windows 7 Pro system with Admin rights, but it produced an empty output file.
by atfon
09 Oct 2017 10:14
Forum: DOS Batch Forum
Topic: Recursive Searching Across Directories & Date Sorting
Replies: 26
Views: 24101

Re: Recursive Searching Across Directories & Date Sorting

This worked like a charm from the root of the hard drive:

robocopy "\." "\." *.txt /l /s /is /ts /ndl /njh /njs /nc /ns /xj /R:0 /W:0

No errors were received. It was faster than the WMIC solutions and did not require administrative rights.
by atfon
09 Oct 2017 08:03
Forum: DOS Batch Forum
Topic: Recursive Searching Across Directories & Date Sorting
Replies: 26
Views: 24101

Re: Recursive Searching Across Directories & Date Sorting

The issue I was seeing with Robocopy was due to it encountering a Junction or Symbolic Link in the Users folder. If I use the /XJ parameter, these are ignored. /xj Excludes junction points, which are normally included by default. https://technet.microsoft.com/en-us/library/cc733145(WS.10).aspx
by atfon
08 Oct 2017 18:09
Forum: DOS Batch Forum
Topic: Recursive Searching Across Directories & Date Sorting
Replies: 26
Views: 24101

Re: Recursive Searching Across Directories & Date Sorting

I have seen some users mention the parameters /R:0 /W:0 with robocopy can be used to suppress access denied messages. I will try this on some test environments tomorrow.
by atfon
08 Oct 2017 17:50
Forum: DOS Batch Forum
Topic: Recursive Searching Across Directories & Date Sorting
Replies: 26
Views: 24101

Re: Recursive Searching Across Directories & Date Sorting

Thanks, Compo Here's my suggestion using RoboCopy I appreciate the suggestion, but I was already testing with RobobCopy like this: for /f "tokens=*" %%a in ('robocopy "\." "\." *.txt /l /s /is /ts /ndl /njh /njs /nc /ns ^| sort /r') do echo %%a >>%userprofile%\Desktop\T...
by atfon
06 Oct 2017 14:58
Forum: DOS Batch Forum
Topic: Recursive Searching Across Directories & Date Sorting
Replies: 26
Views: 24101

Re: Recursive Searching Across Directories & Date Sorting

Generally speaking, I've done this using a command such as the following without error in test environments: FOR /R C:\ %%G in (*.txt) ECHO %%~TG %%G As an addendum to my original posting, I am able to achieve what I need with robocopy, but it is incredibly slow as I'm sure you all know. As the txt ...
by atfon
06 Oct 2017 14:22
Forum: DOS Batch Forum
Topic: Recursive Searching Across Directories & Date Sorting
Replies: 26
Views: 24101

Re: Recursive Searching Across Directories & Date Sorting

Thanks, dbenham. I will attempt to incorporate elements of your script. I intend to recurse the entire local hard drive, but just for files of a type, like *.txt.
by atfon
06 Oct 2017 12:51
Forum: DOS Batch Forum
Topic: Recursive Searching Across Directories & Date Sorting
Replies: 26
Views: 24101

Re: Recursive Searching Across Directories & Date Sorting

I found this posting, but it seems to be primarily focused on getting the current date and timestamp in the yyyymmdd format: http://www.dostips.com/forum/viewtopic.php?f=3&t=4555&hilit=how+to+get+data%2Ftime+independent+from+localization There are some good ideas here, but it doesn't work wi...
by atfon
06 Oct 2017 09:01
Forum: DOS Batch Forum
Topic: Recursive Searching Across Directories & Date Sorting
Replies: 26
Views: 24101

Re: Recursive Searching Across Directories & Date Sorting

Thanks for the tip, Squashman. I will see what I can come up with that will re-format the date in yyyymmdd that will work regardless of regional settings.
by atfon
06 Oct 2017 08:22
Forum: DOS Batch Forum
Topic: Recursive Searching Across Directories & Date Sorting
Replies: 26
Views: 24101

Re: Recursive Searching Across Directories & Date Sorting

With the example I provided in my initial post, the output to file looks something like the following (with hundreds of files): 09/05/2017 10:57 AM C:\list\file.txt 09/05/2017 01:01 PM C:\list\sub\file2.txt 03/05/2014 03:11 AM C:\mylist\new_file.txt 08/26/2015 04:25 PM C:\mylist\new_file2.txt With t...
by atfon
06 Oct 2017 07:55
Forum: DOS Batch Forum
Topic: Recursive Searching Across Directories & Date Sorting
Replies: 26
Views: 24101

Recursive Searching Across Directories & Date Sorting

Hello Folks, I apologize if this has already been answered, but I have yet to find it. I am attempting to generate a batch file that will search for files of a type recursively and generate a list sorted by date regardless of directory. I know I can do something simple like this: for /f "delims...