Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Running a "dir" command from "Scheduled Tasks" returns entire registry

Status
Not open for further replies.

BloodFeastMan

Technical User
Apr 7, 2021
5
US
I have a batch file which contains the following line:

dir /s /a-h-s c:\ >diroutput.txt

as part of an index building process. When I run that from a CMD box, it runs fine, it creates a file of ~ 150 mb and takes about a minute to complete that line. However, after I was satisfied with the entirety, I set it up as a scheduled task that ran in the wee hours, only to find that the file it creates now is ~ 2.2 gb and took over three hours to complete. Upon further review, it seems that most of that file are registry entries not normal files.

Reviewing Scheduled Tasks and checking to see if there's something I've missed with the "dir" command, I can't find how to fix this, maybe one of you can shed light.
 
Did you ever find a solution to this problem? I don't have an answer myself, but, after seeing your post, I have been playing with the DIR command and reading all the docs on it that I can find. I can't see any way in which it could output a list of registry entries - or anything else other than files and folders.

I am really curious as to how this came about. I can only assume there was something else at work in your scheduled task or in the batch file.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Yes, after much frustration, I found that it was simply because Scheduled Tasks runs as administrator. While troubleshooting, I launched a cmd box with admin privileges and ran the dir command as described above, it began the ordeal. Since Scheduled Tasks must run with admin privileges, I couldn't use that option, and the script now runs on a third party scheduler called "RoboIntern", a fully free gem that I found. Additionally, it seems I was wrong about the registry, what I was seeing was a bunch of mile long cryptic filenames that I'd thought were registry. As admin, I'd just kind of presumed that dir would cover pretty much everything, but all of those files were just items in /windows that normies aren't allowed to interact with. Sorry for the confusion.
 
>Scheduled Tasks runs as administrator.

You can change this ...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top