Search code examples
datebatch-filedoswindows-98

Skip entering new date in windows 98 batch file


I create a test.bat file , edit , write DATE and save it.

when i run the bat it show current date then ask for new date , to skip this step i should press enter .

I want to skip entering new date or make it auto press enter .


Solution

  • Windows 98, really?!

    You can do it like this:

    echo 2019-01-02|date
    

    The 2019-01-02 part should be the same when you manually input the date.
    So if the prompt let's you input mm-dd-yy, you should change that to 01-02-19 like date.

    For automatically Enter to date, do this:

    echo.|date
    

    If you are not setting a new date, but just output the current date,
    then(not work in Win98):

    date /T