Scripting Blog [archived]

Formerly known as the "Hey, Scripting Guy!" blog

Can I Read a Text File From the Bottom Up?

(image) Hey, Scripting Guy! I have a log file in which new data is appended to the bottom of the file; that means the most recent entries are at the end of the file. I’d like to be able to read the file starting with the last line and then ending with the first line, but I can’t figure out how to do that.-- MB, Milwaukee, WI (...

Can I Get a List of All My User Accounts?

(image) Hey, Scripting Guy! Is there any way to get a list of all the user accounts in Active Directory?-- CB, Fremont, CA(image) (image) (image) Hey, CB. By far the quickest and easiest way to do this is to search Active Directory for all your user accounts. Here’s a sample script that searches the fabrikam.com domain; to search your own ...

How Can I Call the Dir Command?

(image) Hey, Scripting Guy! I’m trying to do something that seems pretty simple: call the dir command from a script. It doesn’t seem to work, though. How come?-- CR, Mexico City, Mexico(image) (image) (image) Hey, CR. It appears from your mail that you’re trying to do a simple thing like this: However, instead of getting a list of ...