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…

14

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,…

4

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…

7

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…

3

How Can I Send Data from One Script to Another?

Hey, Scripting Guy! A while back you showed how we could use the InputBox function to prompt a user to enter a value we could then use in our script. What I’d like to know is, is there any way I can take that value and use it in another script?— JW Hey, JW. We’re…

1

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…

6

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…

7

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…

27

How Can I Change a Read-only File to a Read-write File?

Hey, Scripting Guy! How can I change a read-only file to a read-write file?— WR Hey, WR. We don’t mean to shock you, but how can you change a read-only file to a read-write file? Why, by using a script, of course! We know: you never saw that coming, did you? As a matter of…

5

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…

3