Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ------------------
- parametry
- @echo off
- if "%2"=="" goto notEnough
- if not "%3"=="" goto tooMuch
- if "%1"=="%2" goto same
- goto different
- :notEnough
- echo Za malo parametrow
- goto end
- :tooMuch
- echo Za duzo parametrow
- goto end
- :same
- echo parametry sa identyczne
- goto end
- :different
- echo parametry sa rozne
- goto end
- :end
- --------------------
- porownaj
- @echo off
- echo .>D:\plik1.txt
- echo .>D:\plik2.txt
- for %%f in (C:\PRACA\*) DO echo %%~nf%%~xf %%~tf %%~zf>> D:\plik1.txt
- for %%f in (C:\DOM\*) DO echo %%~nf%%~xf %%~tf %%~zf>> D:\plik2.txt
- comp D:\plik1.txt D:\plik2.txt /M > temp.txt
- if errorlevel==2 goto exception
- if errorlevel==1 goto different
- if errorlevel==0 goto identical
- :exception
- echo Cannot open one of the files or invalid arguments or invalid switch
- goto end
- :different
- echo Zawartosc jest rozna
- goto end
- :identical
- echo Zawartosc jest identyczna
- goto end
- :end
- del temp.txt
- ---------------
- usun
- @echo off
- if not exist "%1" goto noFile
- choice /C TN /M "Plik %1 zostanie skasowany. Kontynuowac " /T 10 /D N
- if errorlevel==2 goto cancel
- if errorlevel==1 goto delete
- :cancel
- echo Operacja anulowana
- goto end
- :delete
- del %1
- echo Plik %1 skasowany
- goto end
- :noFile
- echo plik %1 nie istnieje
- goto end
- :end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement