Jump to content

Recommended Posts

Posted

Hi Freinds,

I want to make a windows BATCH file that can save Current Date & time inside a TXT file & save the TXT file as somename.txt.......

I checked many sites but din't get a clue how to save current DATE & TIME AS a TXT File..

Can u pls do this small code for me?? Im aware of the date & time Variables in batch but dunno how to create a tXT file from them..

Dunno which is the right section for this but this one seemed the most feasible :rolleyes:

Thx


Posted

The same only different

@ECHO OFF
FOR /F "TOKENS=1-3 DELIMS=." %%a IN ("%time%") DO SET hhmmss=%%a
>>date.txt echo %date%
>>date.txt echo %hhmmss%

Posted

There are may ways to do this. You can even change your prompt and get a directory listing.

@echo offprompt $t $ddir > file.txt

Prompt will show time and date and the listing of the current directory. File will be saved in same directory.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...