Welcome to TechNet Blogs Sign in | Join | Help

Browse by Tags

All Tags » dates and times   (RSS)

Hey, Scripting Guy! Quick-Hits Friday: The Scripting Guys Respond to a Bunch of Questions (10/16/09)

In this post : Has the WMI Problem with Dates and Daylight Saving Time Been Resolved? How Can I Change the Color of Error Messages in the Windows PowerShell Console? How Can I Read a Text File and Update 2,000 User Accounts? Can I Use a WildCard Character

Hey, Scripting Guy! Quick-Hits Friday: The Scripting Guys Respond to a Bunch of Questions (02/06/09)

How Can I Pipe Over a Variable for Use in a File Name? Hey, Scripting Guy! Sorry to bother you but I have been looking for an answer to this for a few hours now. I’ve also been experimenting but have had no luck figuring it out yet. How do you get a variable

How Can I Use Windows PowerShell to Report Back the Name and Creation Date for Files Containing a Specified String Value?

Hey, Scripting Guy! Using Windows PowerShell, how can I search for a string value in all the files in a folder full of text files, then report back the file name and creation date for each file where that string value was found? Oh, and I’d like to have

Hey, Scripting Guy! How Can I Delete Files That Are a Specified Number of Hours Old?

Hey, Scripting Guy! I’ve seen scripts that let you delete all the files in a folder that are X number of days old. I have a different problem: I’d like to delete files that are X number of hours, or even X number of minutes , old. How can I do that? --

How Can I Separate Hours and Minutes in a Date-Time Value?

Hey, Scripting Guy! In determining system uptime I get back a value like 65.75 hours. How can I convert this value to "65 hours and 45 minutes"? -- JM Hey, JM. We’ll see what we can do for you, but we have to be honest: this is a very sad day for the

How Can I Determine the First Friday in a Month?

Hey, Scripting Guy! How can I determine the first Friday in a month? -- JB Hey, JB. You know, when we first glanced at this question we were hoping it said, “How can I determine if any given day in a month is a Friday?” Why? Well, if that was the case

How Can I Save a File Based on the Day of the Week?

Hey, Scripting Guy! I need to save data to a text file each evening. How can I determine the day of the week and then save the file in the appropriate folder? For example, when the script runs on a Thursday then the file should be saved to C:\Logs\Thursday\Results.txt.

How Can I Determine Last Month’s Date?

Hey, Scripting Guy! How can I determine last month’s date? I need to be able to take the month and year for the previous month (using the format mmyy ) and create a file name like this: test0606.xls. -- DR Hey, DR. We have to admit that, at first, this

How Can I Determine Which Day of the Year a Date Falls On?

Hey, Scripting Guy! How can I determine which day of the year a date falls on? For example, March 2, 2006 is the 61 st day of the year. -- TW Hey, TW. You know, we almost feel guilty about answering this question. Why? Well, after all, we can answer it

How Can I Determine the Beginning and Ending Date of the Previous Month?

Hey, Scripting Guy! Given a specific date, how can I determine the beginning and ending date of the previous month? In other words, given 8/11/2005, I need to get back 7/1/2005 and 7/31/2005. -- PH Hey, PH. You know, this was a tough question for us:

How Can I Tell if a Date Falls within a Specified Time Period?

Hey, Scripting Guy! How can I tell if a date falls within a specified time period? -- JW Hey, JW. By amazing coincidence on our way to work this morning we heard two different commercials, from two different companies, touting “Christmas in July.” That

How Can I Determine the Date and Time that a Process Started?

Hey, Scripting Guy! How can I determine the date and time that a process started? -- BM Hey, BM. We’ve got good news for you: not only do we have an answer to your question, but we’re not going to bore everyone with any more stories regarding our Colt

How Can I Determine the Date for the Friday in a Given Week?

Hey, Scripting Guy! Given a date, can a script tell me the date that the Friday for that week occurs? -- DLR Hey, DLR. Too bad you didn’t ask which dates Saturdays, Sundays, and holidays fall on; coincidentally enough, each of the Scripting Guys have

How Can I Determine the Week of the Month a Date Falls In?

Hey, Scripting Guy! How can I determine the week of the month a date falls in? -- AK Hey, AK. You’re probably familiar with the book Moby Dick , the story of a crazy sea captain who became obsessed with hunting down and finishing off the great white whale.

How Can I Determine the Elapsed Time Between Two Dates?

Hey, Scripting Guy! How can I tell how many days there are between two dates? For example, if I have a log file that says an application started on January 1, 2005 and that the application ended today, is there a way to determine how many days the application
More Posts Next page »
 
Page view tracker