Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

batch file

  • 05-10-2005 3:50pm
    #1
    Registered Users, Registered Users 2 Posts: 245 ✭✭


    I've created a batch file that runs each night and works fine. However i want it to create a log file when it ends and put the time and date in it. Does anyone know how this can be done?


Comments

  • Closed Accounts Posts: 6,151 ✭✭✭Thomas_S_Hunterson


    as far as i know, something like this will work
    echo.|date > [textfilename]

    basically when you use > after a command, it outputs the screen text to a text file specified


  • Registered Users, Registered Users 2 Posts: 1,726 ✭✭✭gerryk


    Use >> or the file will be recreated at each echo :D

    Also, there are better things than DOS date for echoing the date...
    Either logtime http://malektips.com/xp_dos_0004.html
    or now http://malektips.com/xp_dos_0010.html


  • Registered Users, Registered Users 2 Posts: 21,264 ✭✭✭✭Hobbes


    Or you can do

    DATE /T > log.txt
    TIME /T >> log.txt

    You could also use the SET command like...

    echo Log completed at %TIME% on %DATE% > log.txt

    No need to install 3rd party programs (if your on XP that is)


  • Registered Users, Registered Users 2 Posts: 245 ✭✭Polonious


    Thats excellent guys thanks. Hobbes, I used that line and it worked just as i wanted. Cheers.


Advertisement