Scripting Blog

A place to learn about PowerShell and share stories of automation

How Can I Start Windows Explorer Opened to a Specific Folder?

Hey, Scripting Guy! How can I start Windows Explorer opened to a specific folder?-- CD Hey, CD. We’re going to let you in on one of the Scripting Guys’ most sordid secrets: sometimes the Scripting Guys don’t agree with each other. No, it’s true; really. For example, some of the Scripting Guys think that soccer is a real sport; even ...

How Can I Determine the Local Path to a Shared Folder?

Hey, Scripting Guy! If I have a UNC path like \\server1\test, can I use a script to determine the local path to that shared folder (like C:\Scripts\Test Folder)?-- JVK Hey, JVK. Yes, you are correct: the Kirkland Fire did open their season last night, rallying for 4 runs in the last two innings to defeat Risan 4-2. And, yes, everyone in the...

How Can I Delete a Folder That Has an Apostrophe in the Name?

Hey, Scripting Guy! How can I delete a folder that has an apostrophe in the name?-- JH Hey, JH. Ah, yes, the apostrophe: every script writer’s arch-nemesis. The apostrophe seems like such a simple little character, but don’t let its appearance fool you: the apostrophe (or the single quote) is probably the most deadly character to be ...

How Can I Determine the Drive Label of a Drive?

Hey, Scripting Guy! Given the drive letter, how can I determine the drive label?-- PM Hey, PM. You know, after sitting around all winter, checking his watch every 15 minutes or so just to verify the date and time, the Scripting Guy who writes this column is pleased to announce that baseball season is officially here. Once more he can enjoy ...

How Can I Write Output to the Screen that Overwrites Whatever is Currently on the Screen?

Hey, Scripting Guy! How can I write output to the screen that overwrites whatever is currently on the screen?-- KM Hey, KM. If you specifically need to write your output to the command window, well, then we don’t have an answer for you: although we played around with a few things, we never found an easy, straightforward way to overwrite ...