Browse by Tags

Tagged Content List
  • Blog Post: 2014 Winter PowerShell Scripting Games Wrap Up #3

    Summary : Microsoft Scripting Guy, Ed Wilson, talks about using standard folders in his review of the 2014 Winter Windows PowerShell Scripting Games. Microsoft Scripting Guy, Ed Wilson, is here. It is beginning to look like spring here in Charlotte, North Carolina. This is a welcome relief, because...
  • Blog Post: List Files in Folders and Subfolders with PowerShell

    Summary : Use Windows PowerShell to list files in folders and subfolders. Hey, Scripting Guy! I am an old VBScript guy. I love using VBScript, and I have done so for nearly 15 years. One reason I love VBScript so much is that, to me, it is easy to use. It is also very powerful. But after attending...
  • Blog Post: The Best Way to Use PowerShell to Delete Folders

    Summary : Microsoft Scripting Guy, Ed Wilson, discusses three ways to use Windows PowerShell to delete folders and then selects the best. Hey, Scripting Guy! I have a question. I occasionally need to delete a large number of folders. What is the easiest way to do this? —BR Hello BR...
  • Blog Post: How Can I Use Information in an Excel Spreadsheet to Rename a Set of Folders?

    Hey, Scripting Guy! How can I rename a bunch of folders using a script? The old folder names are in the first column of an Excel spreadsheet and the new folder names are in the second column of an Excel spreadsheet. -- SF Hey, SF. Oh, and welcome to Hey, Scripting Guy! , your daily source for scripting...
  • Blog Post: How Can I Determine if a Folder Exists on a Computer?

    Hey, Scripting Guy! Is there any way to determine whether or not a specific folder exists on a computer? -- RP, Umatilla, OR Hey, RP. There are a couple ways of doing this, depending on whether you are looking for the folder on the local computer or on a remote computer, and depending on whether or...
  • Blog Post: How Can I Move the Oldest File in a Folder to a Different Folder?

    Hey, Scripting Guy! How can I move the oldest file in the folder C:\Upload to C:\Download? -- DD Hey, DD. Funny you should mention the word “oldest.” The Scripting Guy who writes this column recently attended a family reunion and, for the first time ever, came face-to-face with the whole idea of getting...
  • Blog Post: How Can I Copy the Same File to a Number of Different Computers?

    Hey, Scripting Guy! I regularly update a file that needs to be copied to all of my servers. How can I write a script that will copy the same file (to the same folder) on multiple computers? -- JU Hey, JU. It’s Monday, May 14 th as we write this column, which mean that Mother’s Day in the US is over...
  • Blog Post: Can I Use a Script to Determine the Size of a Folder on a Remote Computer?

    Hey, Scripting Guy! Can I use a script to determine the size of a folder on a remote computer? -- SS Hey, SS. Boy, you’d think you’d be able to do that, wouldn’t you? Especially if you’ve glanced through the WMI class Win32_Directory and noticed the property FileSize. Based on that, you might think...
  • Blog Post: Hey, Scripting Guy! How Can I Get a List of All the Subfolders in a Folder and Then Put That List Into an Array?

    Hey, Scripting Guy! How can I get a list of all the subfolders in a folder and then put that list into an array? -- PW Hey, PW. We know how anxious you’ve all been, waiting to hear whether the Scripting Guys were successfully moved from Building 43 to Building 42 (yes, directly across from...
  • Blog Post: Hey, Scripting Guy! Can I Determine Which Folders Are Using the Most Space on My Computer?

    Hey Scripting Guy! I have a laptop that I bought last year with Windows Vista installed on it. I love it. However, I have been reading all the positive reviews surrounding Windows 7, and I think I am going to install Windows 7 as soon as it is available. In fact, I have already pre-ordered it. The thing...
  • Blog Post: Hey, Scripting Guy! How Can I Determine Folder Size?

    Hey, Scripting Guy! We are getting ready for a migration, and I am trying to find an easy way to determine the size of the Documents folder. I would like to use Windows PowerShell to do this, but when I use the Get-Item cmdlet to retrieve the properties of a folder, I do not see the size. I really do...
  • Blog Post: Don't Translate File and Folder VBScript Scripts into PowerShell

    Summary : Simplify your code and do not translate an old file and folder VBScript script into Windows PowerShell. Hey, Scripting Guy! I know there are not really established patterns and practices for writing VBScript code, or even for writing Windows PowerShell script. But there is code that I like...
  • Blog Post: How Can I Create a Sequential Series of Folders?

    Hey, Scripting Guy! How can I prompt a user to enter a starting number and ending number, then create a sequential series of folders based on those two numbers? -- PM Hey, PM. We had some time to kill this afternoon, so we thought we’d see what we could do about answering your question. In fact, if...
  • Blog Post: 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...
  • Blog Post: How Can I Determine the Size of the My Documents Folder?

    Hey, Scripting Guy! How can I determine the size of the My Documents folder? -- SC Hey, SC. The My Document folder is actually just another folder on the hard disk, one with a path similar to this: C:\Documents and Settings\kenmyer\My Documents. Of course, the actual path will vary depending on the...
  • Blog Post: Hey, Scripting Guy! How Can I Use Windows PowerShell to Delete All the Files in a Folder Older Than 90 Days?

    Hey, Scripting Guy! In Windows PowerShell, how can I determine the number of days difference between two dates? I want to be able to delete all the files in a folder that are more than 90 days old. -- JN Hey, JN. You know, today is October 31 st and, in the US at least, it’s the day when the dark...
  • Blog Post: How Can I Create a Folder on the Start Menu?

    Hey, Scripting Guy! How can I create a folder on the Start menu? I want the folder to be named the same as the %username% environment variable. -- SB Hey, SB. As we are wont to do, we’re going to break this question down into subtasks. We’ll explain how to do each of these subtasks, then at the end...
  • Blog Post: How Can I List All the Files on a User’s Desktop?

    Hey, Scripting Guy! How can I list all the files on a user’s desktop? -- BT Hey, BT. So you thought you could fool the Scripting Guys, did you? Well, you did, at least for awhile. As is so often the case with the Scripting Guys we took one look at your question and thought, “Let’s answer this one;...
  • Blog Post: 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 folder from read-only to read-write...
  • Blog Post: How Can I Determine if a Users' Folder Exists on a Computer?

    Hey, Scripting Guy! How can I determine if the C:\Documents and Settings\ %username% \Application Data\Microsoft\Templates folder exists on a computer? -- JM Hey, JM. The FileSystemObject includes a FolderExists method that makes it very easy to check for the existence of a folder. Just pass FolderExists...
  • Blog Post: Hey, Scripting Guy! Quick-Hits Friday: The Scripting Guys Respond to a Bunch of Questions (7/3/09)

    How Can I List Files and Folders with Special Characters in Their Names? Hey, Scripting Guy! First I would like to thank you for all the good humour you present me every time I need you. I’m trying to use one of your scripts to list the files and folders on my file server. My users are very creative...
  • Blog Post: Easily Compare Two Folders by Using PowerShell

    Summary: Microsoft Scripting Guy Ed Wilson illustrates how to compare two folders by using Windows PowerShell. Microsoft Scripting Guy Ed Wilson here. It is an absolutely beautiful day in Charlotte, North Carolina. The early morning rain gave way to a colorful rainbow. My manager bought me...
  • Blog Post: How Can I Use a Wildcard Character to Delete Folders?

    Hey, Scripting Guy! How can I delete folders based on a wildcard character? For example, how can I delete all the folders whose name starts with December ? -- RR Hey, RR. Well, that depends. If you’re running Windows XP or Windows Server 2003, you can actually use a wildcard character to identify...
  • Blog Post: How Can I Remove the First Five Lines From All the Log Files in a Folder?

    Hey, Scripting Guy! I have about 400 log files in a folder. I need to go in and remove the first 5 lines from each of those log files. How can I write a script to do that? -- JW Hey, JW. Before we begin we need to issue a clarification. A few days ago we reported that the Scripting Guy who writes...
  • Blog Post: Quick-Hits Friday: The Scripting Guys Respond to a Bunch of Questions (8/6/10)

    In this post : How Can I Transfer a Folder from Novel Netware to Windows Server 2008? Why Can't I Run This Script You Guys Wrote? How Can I Clear an Attribute in Active Directory? How Can I Transfer a Folder from Novel Netware to Windows Server 2008? Hey,...