Scripting Blog [archived]

Formerly known as the "Hey, Scripting Guy!" blog

Hey, Scripting Guy! How Can I Use Windows PowerShell to Look at All the Microsoft Office Documents in a Folder?

(image) Hey, Scripting Guy! I am trying to use Windows PowerShell to look at files on my computer; what I want to do is get back a history (that is, the last time a document was accessed) for all the Microsoft Office files in a folder and its subfolders. However, I’m not having much luck. Any ideas would be appreciated.-- KM(image) (image...

Hey, Scripting Guy! How Can I Check to See if Two Lines of Text are in a File and, If They Aren’t, Append Those Lines to the File?

(image) Hey, Scripting Guy! Let me first say that your stuff is great. Really helpful scripts mixed with great humor; you guys are pissa's (Australian slang for “funny”). I have a script that needs to open a file and check to see if two lines of text are in that file. If they are, then I leave the file alone; if they aren’t, I need to ...

Hey, Scripting Guy! How Can I Retrieve Information About All the Shortcut Files in a Folder?

(image) Hey, Scripting Guy! I have a folder with about 1800 shortcuts in it. I need to retrieve the file name and the target for each of these shortcuts in order to import that information into a database. Do you have any idea how I can retrieve this information for each and every shortcut file in a folder?-- JK(image) (image) (image) HeYy...

Hey, Scripting Guy! How Can I Incrementally Rename Files Based on the File Creation Date?

(image) Hey, Scripting Guy! I am trying to get my photos sorted in chronological order, even though – because they come from different cameras – they have different names. For example, one name type starts with DSC followed by a sequential number issued by one camera; another name type starts with IMG followed by a different sequential ...

Hey, Scripting Guy! How Can I Change the Last-Accessed Date of a File to Match Its Last-Modified Date?

(image) Hey, Scripting Guy! How can I change the last-accessed date for all the files in a folder? I want the last-accessed date to match the date and time that the file was last modified.-- GW(image) (image) (image) Hey, GW. Say, did you realize that yesterday was Opening Day for Major League Baseball? If you didn’t, well, don’t feel ...