Hey, Scripting Guy! How can I change the target that a desktop shortcut points to? For example, if I move a file from one server to another, I’d like be able to use a script to change the shortcut that points to that file.– AK Hey, AK. This is an example of a scripting problem…
Year: 2005
How Can I Find and Replace Text in a Text File?
Hey, Scripting Guy! From the command line, how can I use a script to open a file and replace text; for example, how can I replace all instances of “Jim” with “James”?– JW Hey, JW. As we’ve found out numerous times when dealing with text files, there is no obvious way to do this; that…
How Can I Password-Protect an Excel Spreadsheet?
Hey, Scripting Guy! In a previous column, you told us a couple different ways to save Excel spreadsheets. In that column, you said that one of the things you could do with the SaveAs method was password-protect a spreadsheet. However, you didn’t show us an example of this. How can I use a script to…
How Can I Mask Passwords Using an InputBox?
Hey, Scripting Guy! How can I mask passwords using an InputBox? — PG Hey, PG. If you’re hoping to mask passwords using a function or method built into WSH or VBScript we’re afraid you’ll be disappointed; neither technology supports password masking. That doesn’t mean you can’t do it, it just means we’ll have to look…
How Can I Determine Whether or Not a Group Has Any Members?
Hey, Scripting Guy! How can I check a computer and find out whether the Remote Desktop Users group has any members?– ET Hey, ET. Somewhat surprisingly, ADSI doesn’t have any sort of NumberOfMembers property, a property that could tell you – at a glance – how many members are in a group. But that’s all…
How Can I Get a List of All My Windows Server 2003 Computers?
Hey, Scripting Guy! How can I gather the names of all the computers in my domain that are running Windows Server 2003?– AS Hey, AS. When we choose questions to answer for this column, we try to take questions from different areas of scripting. That does two things for us: it keeps us from being…
How Can I Change the Working Folder of a Script?
Hey, Scripting Guy! My script needs to have the same working folder as the application that the script starts. How can I change the working folder of a script?– JM Hey, JM. You can change the current (or working) folder of a script simply by setting the value of the Wscript Shell object’s CurrentDirectory property….
How Can I Make Changes to and Then Re-Save an Existing Excel Spreadsheet?
Hey, Scripting Guy! How can I open an existing Excel spreadsheet, add some additional information to that spreadsheet, and then save my changes? Every time I call the SaveAs method a dialog box pops up asking me if I want to save my changes.– RW Hey, RW. Generally speaking, you can avoid that dialog box…
How Can I Show Users a Dialog Box for Selecting Files?
Hey, Scripting Guy! Is there any way I can use a script to present a user with a dialog box and let him or her select a file?– BF Hey, BF. If you’re using Windows 2000, we don’t know of a way to do this, at least not a way that’s built into the operating…
How Can I Determine the System Time on a Computer?
Hey, Scripting Guy! Is there any way to retrieve the system time as configured on a remote computer?– JJ Hey, JJ. There are at least two ways to do this, both using WMI. If you’re running Windows XP or Windows Server 2003, you can use the WMI class Win32_LocalTime. As you can see, that makes…