Forums before death by AOL, social media and spammers... "We can't have nice things"
|    alt.msdos.batch    |    Fun with MS-DOS batch files    |    42,547 messages    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
|    Message 42,070 of 42,547    |
|    Herbert Kleebauer to Homer Wilson Smith    |
|    Re: Win98 DOS name a file with the date.    |
|    09 Oct 22 13:20:50    |
   
   From: klee@unibwm.de   
      
   On 06.10.2022 08:44, Homer Wilson Smith wrote:   
   > Running Win98 4.10.2222 DOS 5.x or 6.x batch scripts   
   >   
   > Need to write a file or directory with the date.   
   >   
   > echo %date% does not work as it does in future windows.   
   >   
   > Is there a batch script command that will do this for me?   
   >   
   > Thanks Homer W Smith (Lightlink CEO.)   
   >   
      
   :::::::::::::::::::::::::::::::::::::::::::::   
   echo set date=%%2 >call._1_   
   dir call._1_ |find "_1_" >_2_.bat   
   ren call._1_ _1_.bat   
   call _2_.bat   
   del _1_.bat   
   del _2_.bat   
   echo %date%   
   :::::::::::::::::::::::::::::::::::::::::::::   
      
   In NT+ this works only if you use the /-n in the dir command:   
   dir /-n call._1_ |find "_1_" >_2_.bat   
      
      
   Or a more flexible version (works only in DOS or 32 bit Windows):   
      
   @echo off   
   echo Bj@jzh`0X-`/PPPPPPa(DE(DM(DO(Dh(Ls(Lu(LX(LeZRR]EEEUYRX2Dx=>d_t.com   
   echo 0DxFP,0Xx.t0P,=XtGsB4o@$?PIyU WwX0GwUY Wv;ovBX2Gv0ExGIuht6>>d_t.com   
   echo LisqMz`wGH@wKuur`G@w?ogBgGG}G?j_egoNOG?w?`gBLksqgG`w?WgBgG>>d_t.com   
   echo G}G?R_MgoNMy?wSx@W?s?W?@zAB`LrFuBLyt~vuco{@LuKooD?BFHqrIcP>>d_t.com   
   echo _sdDxb1T??=?rILO_sdDqx1T??=?rILO_sdDnl1T??=?rILO_sdD`c1T??>>d_t.com   
   echo =?rILO_sdDgg1T??=?rILO_sdDll1T??=?rILO_sdDrr1T??=??IL?0xxx>>d_t.com   
      
   d_t.com>d_t.bat   
   call d_t.bat   
   del d_t.com   
   del d_t.bat   
      
   echo century: %_cy%   
   echo year: %_yr%   
   echo month: %_mo%   
   echo day: %_da%   
   echo hour: %_hh%   
   echo minute: %_mm%   
   echo second: %_ss%   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
(c) 1994, bbs@darkrealms.ca