Jump to content


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.

Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.


Command Prompt Question

  • Please log in to reply
1 reply to this topic

#1 yakabouski


  • Members
  • 2 posts
  • Local time:07:07 AM

Posted 03 September 2007 - 08:02 PM

I'm just learning about batch files etc and I'm trying to create a test batch file using the date command.

I want to show the date only (without having to input a date separately) then save the output into a text file. Then I want to change the date. Then I want to take whatever is in the text file and pipe it into the date command. Finally, I want to delete the text file. So far I have this:

@echo off
date /t >> date.txt
date 09-02-2007
type date.txt | date
del date.txt

However, I have this problem... using the date command along with the /t switch, the output format is like this: Mon 09/03/2007. When I want to pipe the contents of the text file into the date command, the format required is like this: 09/03/2007 (no day of the week). Is there a way to take out the day from the output of the date /t command?

Or... does anyone have any other ideas to help me out with this batch file?

Many thanks beforehand!

BC AdBot (Login to Remove)


#2 yakabouski

  • Topic Starter

  • Members
  • 2 posts
  • Local time:07:07 AM

Posted 03 September 2007 - 10:51 PM

Hey everyone-
I figured it out, in case anyone was curious. I went into the language and regional settings from control panel and edited the date tab after clicking customize.

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users