Backdoor Tech

Examples of Batch Files

These batch files were taken from the set of messages 4DOS10.zip from FIDOnet in 1994-1995. These were provided by Klaus Meinhard Send a message to Klaus, a long-time 4DOS user. They mostly correspond to 4DOS version 5.5 and predated Windows 95. They are provided here for historical and learning purposes. We have selected examples that still seem relevant for current use. Not many people running bulletin board services, for instance, and many examples came from managing messages and files on a BBS. If you wish you can download the original file Download archive - 130 kb.

Warning: We cannot make any guarantee how the batch files will work on your system. You may need to edit them so that they match your setup. Use them at your own risk.

DiskTOT

Saul Levy and Phi Nguyen

WARNING: If you want to study this program, make sure to make
          a copy of it BEFORE running it. This program is what
          I called a SMBF (Self Modify Batch File). It will
          modify part of itself when running the first time.

 -------------DISKTOT.BTM v2.0-----------------------
 @echo off
 setlocal
 cls 15 on 1
 scrput 0 5 bri yel on red ---=== DiskTOT version 3.0 ===---
 screen 4 0

 :::-= Configuration routine =-
 set f=%@name[%0].BTM
 iff not exist %f then
   scrput 3 5 bri yel on blu Can't find %f!
   scrput 5 5 bri gre on blu %f has to be in the current directory.
   screen 10 0
   quit
 endiff

 set d=C D E F G H I J K L M N O P Q R S T U V W X Y Z
 set d=%@substr[%d,0,%@eval[(%@ascii[%_lastdisk]-66)*2=0]]
 set t=%@len[%d]

 scrput 3 5 bri whi on blu Your system has the following drives:
 scrput 5 5 bri gre on blu %d
 scrput 7 5 bri whi on blu Which drive(s) do you want to exclude:
 screen 7 44
 input /cnx /l%@eval[%t-(%t\2)=0] %%n
 scrput 9 5 bri yel on blu Removing -= %@upper[%n] =- from list...
 do x=0 to %@eval[%@len[%n]-1=0]
  set t=%@index[%d,%@substr[%n,%x,1]]
  if %t eq -1 iterate
  set d=%@substr[%d,0,%t]%@substr[%d,%@eval[%t+2=0]]
 enddo

 scrput 11 5 bri red on blu Updating %f...
 set t=%@unique[%temp]
 ffind /kmvxt":::-=" %f >! %t
 set n=%@substr[%@line[%t,0],7]
 set l=%@eval[%@instr[7,9,%@line[%t,2]]-%n=0]
 del /q %t

 set t=%@fileopen[%f,append,b]
 set n=%@fileseek[%t,%n,0]
 set l=%@eval[%l-1-%@filewrite[%t,set d=%d]=0]
 set n=%@eval[%l\200=0]
 do x=1 to %n
   set m=%@filewriteb[%t,200,%@repeat[ ,200]]
 enddo
 set l=%@eval[%l-%n*200=0]
 set n=%@filewrite[%t,%@repeat[ ,%l]] %@fileclose[%t]
 %f
 :::-= End of Configuration routine =-

 set h=%@if["%@instr[1,1,%@eval[1/2=1]]"==".",.5,,5]
 set l=%@repeat[%@char[205],44]
 unset /q dtt dut dft

 scrput 2 5 bri cya on blu `Total Kb   Used Kb    %   Free Kb    %`
 scrput 3 0 bri gre on blu %l
 for %a in (%d) do gosub getnums
 scrput +0 0 bri gre on blu %l
 set dutp=%@eval[%dut/%dtt*100+%h=0.0]
 set dftp=%@eval[100-%dutp=0]

 echo.
 echos %@format[13,%@comma[%dtt]]%@format[10,%@comma[%dut]]
 echo %@format[5,%dutp]%@format[10,%@comma[%dft]]%@format[5,%dftp]
 quit

 :getnums
 set dt=%@disktotal[%a:,Kc]
 set df=%@diskfree[%a:,Kc]
 set dfp=%@eval[%df/%dt*100+%h=0.0]
 set du=%@comma[%@eval[%dt-%df=0]]
 set dup=%@eval[100-%dfp=0]
 set dtt=%@eval[%dtt+%dt=0]
 set dut=%@eval[%dut+%du=0]
 set dft=%@eval[%dft+%df=0]
 echos  %a:%@format[10,%dt]%@format[10,%du]%@format[5,%dup]
 echo %@format[10,%df]%@format[5,%dfp]
 return

 -----------------------HISTORY--------------------------
 DISKTOT.BTM v1.6 by Saul Levy, Tucson, Arizona, 10/21/94,
 DISKTOT.BTM v1.7 by Phi Nguyen, Charlotte, North Carolina, 10/25/94
    ++ Automatically detect all your hard drives
 DISKTOT.BTM v1.8 by Phi Nguyen, 11/05/94
    ++ Add international detection: commas vs period
 DISKTOT.BTM v1.9 by Phi Nguyen, 11/10/94
    ++ Fix bug in version 1.8
    ++ Increase execution speed a bit. Every micro-second counts! 
 DISKTOT.BTM v2.0 by Phi Nguyen, 11/12/94
    ++ Fix bug in v1.9 which supposed to fix bug in v1.8 
    ++ Fix no-ANSI problem
    ++ Faster calculations
    ++ Add configuration routine
    ++ Add SMBF routine
 DISKTOT.BTM requires 4DOS version 5.5 revision A or B
 -------------DISKTOT.BTM v2.0-----------------------
 

Consulting Hours and Fees

Michael Nunneley


***********   START HERE   ***********************
input   How many Hours for MONDAY? %%m_hours
input   How many Hours for TUESDAY? %%t_hours
input   How many Hours for WEDNESDAY? %%w_hours
input   How many Hours for THURSDAY? %%th_hours
input   How many Hours for FRIDAY? %%f_hours
input   How many Hours for SATURDAY? %%s_hours
input   How many Hours for SUNDAY? %%su_hours
set
hours=%@eval[%m_hours+%t_hours+%w_hours+%th_hours+%f_hours+%s_hours+%su_hours]
input   How many Hours of Overtime? %%ot
input   How much per hour? %%rate
set REG_PAY=%@eval[%hours*%rate]
set OT_PAY=%@eval[%ot*(%rate*1.5)]
set OT_RATE=%@eval[%rate*1.5]
set TOTAL_PAY=%@eval[%REG_PAY+%OT_PAY]
set DT=%_DATE
set EST_1=%@eval[%TOTAL_PAY*.11]
set EST_2=%@eval[%TOTAL_PAY-%EST_1]
echo %hours >c:\batch\income\ytd.tmp
echo %ot >>c:\batch\income\ytd.tmp
echo %TOTAL_PAY >>c:\batch\income\ytd.tmp
echo                                            DATE:      %DT
>>c:\batch\income\%DT.rpt
echo ============ >>c:\batch\income\%DT.rpt
echo Hours Worked >>c:\batch\income\%DT.rpt
echo ============ >>c:\batch\income\%DT.rpt
echo MONDAY             %m_hours >>c:\batch\income\%DT.rpt
echo TUESDAY            %t_hours >>c:\batch\income\%DT.rpt
echo WEDNESDAY          %w_hours >>c:\batch\income\%DT.rpt
echo THURSDAY           %th_hours >>c:\batch\income\%DT.rpt
echo FRIDAY             %f_hours >>c:\batch\income\%DT.rpt
echo SATURDAY           %s_hours >>c:\batch\income\%DT.rpt
echo SUNDAY             %su_hours >>c:\batch\income\%DT.rpt
echo OVERTIME HOURS:    %ot >>c:\batch\income\%DT.rpt
echo =========== >>c:\batch\income\%DT.rpt
echo Totals >>c:\batch\income\%DT.rpt
echo =========== >>c:\batch\income\%DT.rpt
echo REGULAR HOURS PAY:         %REG_PAY >>c:\batch\income\%DT.rpt
echo OVERTIME HOURS PAY:        %OT_PAY >>c:\batch\income\%DT.rpt
echo TOTAL PAY:                 %TOTAL_PAY >>c:\batch\income\%DT.rpt
echo ESTIMATED PAY:             %EST_2 >>c:\batch\income\%DT.rpt
set YTD_H=%@lines[c:\batch\income\ytd.tmp,0]
set YTD_O=%@lines[c:\batch\income\ytd.tmp,1]
set YTD_TP=%@lines[c:\batch\income\ytd.tmp,2]
echo %@eval[%YTD_H+%hours] >>c:\batch\income\ytd.txt
echo %@eval[%YTD_O+%ot] >>c:\batch\income\ytd.txt
echo %@eval[%YTD_TP+%TOTAL_PAY] >>c:\batch\income\ytd.txt
del c:\batch\income\*.tmp
********   CLIP HERE    ****************


Sister Sites

Peruvian Graffiti
Prana Journal