Wrox Programmer Forums
|
Other Programming Languages If you have a coding issue to discuss about another language that really isn't provided for in any other forum here (not ASP.NET C#, C++, VB, PHP, JavaScript, Python, Java, Perl, Applescript, XML or any of the other forum topics we have), post it here. Enough discussion on a language we don't have covered could prompt a new forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Other Programming Languages section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old November 13th, 2007, 05:04 PM
Registered User
 
Join Date: Nov 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Add Date to File Using Cmd

Hello,

I have a batch file that is executing cmd statements. I am using this code to append the current date to a file before moving it to another location. I now have a need to use yesterday's date instead but don't know how to modify this script to do this. Here is my current date script:

for /F "tokens=1-4 delims=/ " %%i in ('date /t') do (
   set DayOfWeek=%%i
   set Month=%%j
   set Day=%%k
   set Year=%%l
   set Date=%%i %%j/%%k/%%l
)

Thanks!
Reply With Quote
  #2 (permalink)  
Old November 13th, 2007, 05:16 PM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

ExpertsExchange knows the answer:
http://www.experts-exchange.com/OS/M..._21316459.html

You have to sign up to view the solution of course.

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
================================================== =========
.: Wrox Technical Editor :.
Wrox Books 24 x 7
================================================== =========
Reply With Quote





Similar Threads
Thread Thread Starter Forum Replies Last Post
EXCEL 2003 Can't add DATE PIVOTITEM bill9376 Excel VBA 0 May 15th, 2008 02:11 PM
running a batch file from cmd from C# Bill_Thompson C# 2 March 29th, 2008 07:56 AM
How to add more file uploads? fyp4135 C# 2005 3 November 8th, 2006 11:55 PM
Add Date in Catalog Backup Script sagato Need help with your homework? 0 September 19th, 2006 04:25 PM
Add an hour to a date (solution) g000we Classic ASP Basics 1 July 26th, 2006 06:24 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.