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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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