How Can I Tell Whether a Value Exists in the Registry?

Hey, Scripting Guy! How can I tell whether a value exists in the registry on a remote computer?— AL Hey, AL. Full disclosure time: even though we go by the name The Scripting Guys, we don’t claim to know everything there is to know about scripting. This question is a good example of that. When… Read more

How Can I Create a CSV File?

Hey, Scripting Guy! How can I create a CSV file?— LF Hey, LF. For those of you who aren’t up on your acronyms, CSV is short for comma-separated-values file, a text file in which individual elements are separated by commas. For example, say you have a CSV file consisting of user first names, last names,… Read more

How Can I Change the Screensaver Timeout Value?

Hey, Scripting Guy! Can I use a script to change the timeout value for the screensaver on a computer?— JN Hey, JN. For some reason, Microsoft’s scripting technologies come up a little short any time you’re talking about Windows settings and components, things like screensavers, wallpaper, the Taskbar, the Start menu, etc. You can use… Read more

Hey, Scripting Guy! Can I Retrieve Just Failure Events from the Security Event Log?

Hey, Scripting Guy! Is there a way to retrieve just Failure Audit events from the Security event log?— KA Hey, KA. Interesting, isn’t it: any time the subject is failure, people turn to the Scripting Guys. What makes you think we know anything about failure? Ok, you’re right: silly question. As far as your question… Read more

How Can I Display a Hyperlink in a Message Box?

Hey, Scripting Guy! Is it possible to have a hyperlink to a Web page in a message box?— CB Hey, CB. Sounds like you want to display a message box to users and, ideally, you’d like to include a hyperlink they could click on for more information. For example, suppose a user tried to access… Read more

How Can I Determine the OU a User Account Belongs To?

Hey, Scripting Guy! How do I determine the OU a user account belongs to?— CO Hey, CO. Ah, yes: the OU a user belongs to. No doubt a lot of you are thinking, “Well, there’s probably an OU property of some kind in Active Directory that gives you that information. All you have to do… Read more

How Can I Get a List of All the Files in a Folder and Its Subfolders?

Hey, Scripting Guy! How can I use a script to show me all the files in a folder? And then how can I modify that script so it shows me all the files in any subfolders of that folder?— CS Hey, CS. Yesterday we showed everyone a script that changed all the files in a… Read more

How Can I Pick Out and Save Specific Lines in a Text File?

Hey, Scripting Guy! I’d like to be able to read through a text file, select the lines that begin with a particular word (like Failure), and then save only those lines back to the same text file. Is there any way to do that?— AC Hey, AC. Hey, AC. For simplicity’s sake, we’re assuming you… Read more