Scripting Blog

A place to learn about PowerShell and share stories of automation

How Can I Use the RunAs Command to Run a Script Under Alternate User Credentials?

Hey, Scripting Guy! How can I use the RunAs command to run a script under alternate user credentials?-- BE Hey, BE. You know, in the business world one of the hot topics these days is synergy. For example, after The Mighty Ducks became a hit movie the Disney Company went out and bought themselves an NHL hockey team, renaming it the Anaheim ...

How Can I Print Just the Text Area of an HTA?

Hey, Scripting Guy! I have an HTA where information gets written to a text area. How can I print just the information found in that text area?-- DS Hey, DS. We want you to level with us here: are the Scripting Guys dead? We ask that because we saw the movie The Sixth Sense a few years ago and we understand how this life/death thing works. ...

How Can I Get a List of All My Internet Cookies?

Hey, Scripting Guy! How can I get a list of all my Internet cookies?-- ZO Hey, ZO. OK, we have to admit it: you tricked the Scripting Guys, and we fell for it, hook, line, and sinker. As soon as we saw your email - and the word “cookies” - there was a mad scramble to see who would get to answer this question. It was only after the dust ...

How Can I Determine the Name of the Local Computer Using WMI?

Hey, Scripting Guy! How can I determine the name of the local computer using WMI?-- BM Hey, BM. As you noted in your email we Scripting Guys always tell people that, in WMI, you can simply use a dot (.) to refer to the local computer. For example, the following mini-script connects you to the WMI service on the local computer:strComputer...

How Can I Select a Column of Data in Excel and Then Paste that Data into a Text File?

Hey, Scripting Guy! How can I select a column of data in Excel and then paste that data into a text file?-- GT Hey, RR. You know, if you’re like most people, any time you hear the words “Scripting Guys” you undoubtedly think of two things: elegance and sophistication. Despite our well-deserved reputation, however, the Scripting Guys ...

Feedback usabilla icon