Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

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

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

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

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.

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

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 Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads

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

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.

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

>Scheduled Tasks runs as administrator.

You can change this ...

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close