.


:




:

































 

 

 

 


setlocal endlocal




setlocal , . , endlocal, , . , - , . , .

call

, (, , ). . , , call, :

call --

 

start

start :

start [" "] [/d ] [/i] [/min] [/max] [{/separate | /shared}]

[{/low | /normal | /high | /realtime | /abovenormal | belownormal}]

[/wait] [/b] [ - ] [ ]

" " . - . - , .

start :

/d ;

/i cmd.exe ;

/min /max ;

/separate /shared 16- ;

/low, /normal, /high, /realtime, /abovenormal belownormal , , , , ;

/wait ;

/b ( Ctrl+C , Ctrl+C, Ctrl+Break).

start .

cmd

cmd :

cmd [[{/c|/k}] [/s] [/q] [/d] [{/a|/u}]

[/t: ] [/e:{on|off}] [/f:{on|off}] [/v:{on|off}] ]

cmd :

/c /k , ,

/s /c /k;

/q ;

/d AutoRun;

/a /u ANSI Unicode;

/t: (. 2.1.14.2.4);

/e:on /e:off ;

/f:on /f:off ;

/v:on /v:off .

pause

pause (, , ). :

...

. - , Enter, .

, .. . :

-1 & -2 -2 -1;

-1 && -2 -2 -1 , -1 ( );

-1 || -2 -2 -1 , -1 ( );

(-1 & -2) -1 -2 .

viewer.bat , ( .bat) edit ( edit ).

() ( ".").

() :

bat ( .bat);

text ( .txt);

all .

, all.

. . edit , , . , . . / .

for.

/? : , .

.

-:

@echo off

echo *****************************************

echo * *

echo *****************************************

, , :

rem

if %1- EQU - (

rem

echo .

echo viewer /?

rem

goto exit

)

:

rem

if -%1- EQU -/?- (

echo viewer.bat

echo

echo .txt

echo edit .bat

echo : viewer - [-]

echo - .,

echo

echo - :

echo bat -

echo text -

echo all -

echo - ,

echo all

echo

echo

goto exit

)

, :

rem

rem

setlocal

rem ,

if %1 NEQ. (

pushd %1

)

rem

if errorlevel 1 (

rem

echo %1

rem

goto exit

)

pushd , . , . exit.

:

rem ====== ======

echo :

rem

set /p search_string=

, ( yes , no ). yes:

rem ====== ======

rem yes

set bat_output=yes

rem yes

set text_output=yes

all, files_output:

rem

if -%2 EQU - (

rem

goto files_output

)

rem all

if %2 EQU all (

rem

goto files_output

)

bat, no files_output:

rem bat

if %2 EQU bat (

rem no

set text_output=no

rem

goto files_output

)

text, no files_output:

rem text

if %2 EQU text (

rem no

set bat_output=no

rem

goto files_output

)

, all, bat text, .. , :

rem ====== ======

echo %2 .

echo viewer /?.

goto dir_restore

, :

rem ====== ======

:files_output

rem

rem

set /a text_ount=0

rem

for %%f in (*.txt) do set /a text_ount+=1

rem

rem

set /a bat_count=0

rem

for %%f in (*.bat) do set /a bat_count+=1

:

rem

if %text_output% EQU yes (

rem

if "%text_count%" NEQ "0" (

rem -

if -%search_string% NEQ - (

rem ,

rem

rem

rem ,

rem ,

rem

for %%f in (*.txt) do

find %%f "%search_string%" >

temp$$$$.txt &&

(echo %%f &

C:\WINDOWS\Notepad.exe temp$$$$.txt &

erase temp$$$$.txt) ||

echo %%f:

) else (

rem

rem

for %%f in (*.txt) do

echo %%f &

C:\WINDOWS\Notepad.exe %%f

)

rem

echo '%CD%':

%text_ount%

) else (

rem

rem

echo %CD%

)

)

:

rem

if %bat_output% EQU yes (

rem

if "%bat_count%" NEQ "0" (

rem -

if -%search_string% NEQ - (

rem ,

rem

rem

rem edit,

rem ,

rem

for %%f in (*.bat) do

find %%f "%search_string%" >

temp$$$$.txt &&

(echo %%f &

edit temp$$$$.txt &

erase temp$$$$.txt) ||

echo %%f:

) else (

rem

rem edit

for %%f in (*.bat) do

echo %%f & edit %%f

)

rem

echo '%CD%':

%bat_ount%

) else (

rem

rem

echo %CD%

)

)

:

rem

if exist temp$$$$.txt (

rem

erase temp$$$$.txt

)

, , :

:dir_restore

rem -

if %1 NEQ. (

rem

popd

)

:exit

rem

rem

endlocal

:

D:\ >viewer.bat.

******************************************

* *

******************************************

:

var2

dircontANSI.txt

dircontUTF-16.txt

dircont.txt

dir2.txt:

dir1.txt:

'D:\ ': 5

test.bat

testset.bat:

testecho.bat:

viewer.bat:

'D:\ ': 4

5. ( 2)

1. :

2. temp.

3. temp (,.txt,.doc,.exe ..).

4. ( copy con -) .bat.

5. OEM (DOS). Far ( DOS), ( Terminal), Bred3 ( OEM).

6. /? : , .

7. :

, ;

, ;

, , , .

8. .

9. .

10. Far .

11. .

12. , , , , -, temp.

5-01

( dir) .

() ( "."). () :

prog ( .com .exe);

bat ( .bat);

text ( .doc .txt);

all .

, , ( * ?).

prog, bat text (, ).

5-02

, ( dir) , .

() ( "."). () :

d ;

f , ;

p .

, d.

f, , .

5-03

( copy) .

() ( "." ). () :

image ( .bmp,.gif,.jpg .png);

prog ( .com .exe);

text ( .doc .txt);

all .

, all.

, ( "."). , , . , mkdir.

image, prog text (, ).

5-04

, , , .

() ( "."). () :

image ( .bmp,.gif,.jpg .png);

doc Word ( .doc);

text ( .txt);

prog ( .com,.bat .exe).

, .

, ( dir /a:d /b), - . , . , "." ( ), ".." ( ). , .

5-05

, -, .

() ( "."). () :

bak .bak;

tmp .tmp.

, ( .bak .tmp).

, - , ( dir findstr) .

. n, . y, ( ). bak .bak, . tmp .tmp. , .bak /.tmp.

, / -.

5-06

, (, doc txt) exist if.

() ( "."). () /erase. , ( ) .

( ".").

, - , ( dir findstr), . , - .

5-07

, (, a1) exist if .

() ( "."). () /chars. , .

( "." ).

, - -, -: -, - :

.com .exe;

.bat;

.bmp,.gif,.jpg .png;

.txt .doc);

.

dir findstr. , .

5-08

, , ( find /c) . for.

() ( "."). () :

text ( .txt);

bat ( .bat);

all ( .txt .bat).

, ( "?" "*") ( ).

.

, - -.

, - , " - ", , .

text , bat , all .

5-09

, .

() ( "."). () , :

image .bmp,.gif,.jpg .png ( C:\WINDOWS\system32\mspaint.exe);

bat .bat ( edit);

text .txt ( C:\WINDOWS\Notepad.exe).

, ( "?" "*") ( ).

image , bat , text , all , .

5-10

, , findstr ( ), . for.

() ( "."). () :

text ( .txt);

bat ( .bat);

all ( .txt .bat).

, ( "?" "*") ( ).

.

C:\WINDOWS\Notepad.exe, edit.

text , bat , all .

, -, -.

5-11

, .

() ( "."). () : /asc /desc . , .

( for /L) ( ). , .

dir /B. . .

, -.

 

5-12

, .

() , ( "."). () :

text ( .txt);

prog ( .bat);

all .

, ( "?" "*") ( ).

( ) .

( for /L) ( 1 ) ( , ). , ( ren) , .

, -.

5-13

, , ( find) . for.

() ( "."). () :

text ( .txt);

bat ( .bat);

all .

, ( "?" "*") ( ).

( for /L) ( ). , .

, -.

, , . , , .

text , bat , all .

5-14

, , ( ) ( find) . for.

() ( "."). () :

/yy , ;

/yn , , ;

/ny , , ;

/nn , , .

, /yy.

() , ( "*" / "?". , .

( ) ( ).

( , , ).

: , , find /v.

5-15

, .

() ( "."). () /chars. , , .

. .

( for) / ( ) : : yes no. yes, , no . ( yes no), .

, -.

 

:

1. .

2. ( - , ).

3. ( ).

4. ( /?).

5. , .

6. , .

7. .

 

 

1. Windows ?

2. Windows? ?

3. Windows? .

4. Windows? "@" Windows?

5. cls, rem color Windows?

6. pushd popd Windows? Windows?

7. if Windows?

8. if Windows?

9. if Windows?

10. find Windows?

11. findstr Windows?

12. findstr Windows?

13. sort Windows?

14. for /D Windows?

15. for /R /L Windows?

16. for /F Windows?

17. , , set Windows?

18. set Windows?

19. set Windows?

20. set Windows?

21. setlocal endlocal ?

22. call pause Windows?

23. start Windows?

24. cmd Windows?

25. Windows?

 

 





:


: 2016-11-12; !; : 706 |


:

:

, ,
==> ...

1477 - | 1455 -


© 2015-2024 lektsii.org - -

: 0.209 .