Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 7) sizesum
- Суммарный размер всех файлов на всех дисках
- @echo off
- setlocal enabledelayedexpansion
- set b=0
- set summ=
- for %%z in (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z) do (
- if exist %%z:\ (
- for /f "tokens=3" %%i in ('dir %%z:\ /a-d /s ^| findstr /b "[0-9]"') do (
- for %%j in (%%i) do (
- set chis=!chis!%%j
- )
- set a=!chis!
- set chis=
- for /l %%n in (1,1,14) do (
- if not defined a (
- if not defined b (
- if !c! equ 1 (
- set c=0
- set summ=1!summ!
- )
- )
- )
- if defined a (
- if defined b (
- set /a summx=!c!+!a:~-1!+!b:~-1!
- if !c! equ 1 set c=0
- if !summx! geq 10 (
- set c=1
- set summx=!summx:~-1!
- )
- set a=!a:~,-1!
- set b=!b:~,-1!
- set summ=!summx!!summ!
- ) else (
- set /a summx=!c!+!a:~-1!
- if !c! equ 1 set c=0
- if !summx! geq 10 (
- set c=1
- set summx=!summx:~-1!
- )
- set a=!a:~,-1!
- set summ=!summx!!summ!
- )
- ) else (
- if defined b (
- set /a summx=!c!+!b:~-1!
- if !c! equ 1 set c=0
- if !summx! geq 10 (
- set c=1
- set summx=!summx:~-1!
- )
- set b=!b:~,-1!
- set summ=!summx!!summ!
- )
- )
- )
- set b=!summ!
- set summ=
- set summx=
- )
- )
- )
- echo !b!
- endlocal
- 1.2) copspeed
- @echo off
- for /f "tokens=1,2,3 delims=:" %%a in ("%time%") do (
- set h=%%a
- set m=%%b
- set s=%%c
- )
- for /f "tokens=1,2 delims=," %%i in ("%s%") do (
- set sec=%%i
- set ms=%%j
- )
- if %m%==08 (set m=8)
- if %m%==09 (set m=9)
- if %sec%==08 (set sec=8)
- if %sec%==09 (set sec=9)
- if %ms%==08 (set ms=8)
- if %ms%==09 (set ms=8)
- set /a st=%h%*60*60*100+%m%*60*100+%sec%*100+%ms% 2>nul
- copy %1 %2 > nul
- for /f "tokens=1,2,3 delims=:" %%a in ("%time%") do (
- set h=%%a
- set m=%%b
- set s=%%c
- )
- for /f "tokens=1,2 delims=," %%i in ("%s%") do (
- set sec=%%i
- set ms=%%j
- )
- if %m%==08 (set m=8)
- if %m%==09 (set m=9)
- if %sec%==08 (set sec=8)
- if %sec%==09 (set sec=9)
- if %ms%==08 (set ms=8)
- if %ms%==09 (set ms=8)
- set /a ct=%h%*60*60*100+%m%*60*100+%sec%*100+%ms% 2>nul
- set /a dt=%ct%-%st% 2> nul
- echo %dt% msec
- echo %~z1 byte
- set /a s=%~z1/1048576*100/%dt%
- if %s% == 0 (echo %~z1 byte per second) else (echo %s% Mb/sec)
- 8) похоже это квадрат числа (надеюсь она никому не попадется)
- @echo off
- SETLOCAL EnableDelayedExpansion
- set a=%1
- if !a! leq 0 set a=!a:~1!
- set summ=0
- set k=
- set cc=!a!
- set b=!a!
- set o=
- set summx=0
- for /l %%j in (1,1,20) do (
- if defined cc (
- set c=!cc:~-1!
- for /l %%i in (1,1,20) do (
- if defined a (
- set /a mn=!a:~-1!*!c!
- call :sum !summ! !mn!!k! summ
- set k=!k!0
- set a=!a:~,-1!
- ))
- call :sum !summx! !summ!!o! summx
- set o=!o!0
- set cc=!cc:~,-1!
- set a=!b!
- set summ=0
- set k=
- ))
- echo !summx!
- endlocal
- goto :eof
- :sum
- set az=%1
- set bz=%2
- set summxz=0
- set summz=
- for /l %%n in (1,1,50) do (
- if not defined az (
- if not defined bz (
- if !cz! equ 1 (
- set cz=0
- set summz=1!summz!
- )))
- if defined az (
- if defined bz (
- set /a summxz=!cz!+!az:~-1!+!bz:~-1!
- if !cz! equ 1 set cz=0
- if !summxz! geq 10 (
- set cz=1
- set summxz=!summxz:~-1!
- )
- set az=!az:~,-1!
- set bz=!bz:~,-1!
- set summz=!summxz!!summz!
- ) else (
- set /a summxz=!cz!+!az:~-1!
- if !cz! equ 1 set cz=0
- if !summxz! geq 10 (
- set cz=1
- set summxz=!summxz:~-1!
- )
- set az=!az:~,-1!
- set summz=!summxz!!summz!
- )
- ) else (
- if defined bz (
- set /a summxz=!cz!+!bz:~-1!
- if !cz! equ 1 set cz=0
- if !summxz! geq 10 (
- set cz=1
- set summxz=!summxz:~-1!
- )
- set bz=!bz:~,-1!
- set summz=!summxz!!summz!
- )))
- set %3=!summz!
- exit /b
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement