Anti-Phishing software with batch -



Anti-Phishing software with batch -

i trying create basic anti-phishing software batch. using delete html files similar gmail login page. here's code:

@echo off color fc title anti-phishing cls echo =============== echo [anti-phishing] echo =============== echo if there's no message ,you protected. set /p a=enter html file scan: /f %%x in ('findstr /i /m "gmail google add together account" %a%.html') ( if /i %%x equ %a%.html ( /f %%z in ('findstr /i /b /m "tskill del re-create shutdown ipconfig ren reg" %a%.html') ( if /i %%z equ %a%.html ( cls echo false page detected!! del %a%.html echo %a%.html deleted.... pause >nul ) ) ) ) pause >nul

it says cannot open html file. please help me understand mistake. pretty new batch.

here code little bit improved:

@echo off color fc title anti-phishing cls echo =============== echo [anti-phishing] echo =============== echo if there's no message ,you protected. set "htmlfile="" set /p "htmlfile=enter html file scan: " set "htmlfile=%htmlfile:"=%" if "%htmlfile%"=="" goto :eof if "%htmlfile:~-5%"==".html" set "htmlfile=%htmlfile:~0,-5%" if "%htmlfile%"=="" goto :eof if not exist "%htmlfile%.html" ( echo file "%htmlfile%.html" not found. echo. echo exit key ... pause>nul goto :eof ) /f %%x in ('%systemroot%\system32\findstr.exe /i /m "gmail google add together account" "%htmlfile%.html"') ( if /i %%x equ "%htmlfile%.html" ( /f %%z in ('%systemroot%\system32\findstr.exe /i /b /m "tskill del re-create shutdown ipconfig ren reg" "%htmlfile%.html"') ( if /i "%%z" equ "%htmlfile%.html" ( cls echo false page detected!! del "%htmlfile%.html" echo "%htmlfile%.html" deleted. pause >nul ) ) ) ) pause >nul

this batch file first defines environment variable htmlfile double quote string value.

the next line after user prompt removes double quotes come in perhaps user string. results in empty string if user on prompt nail homecoming or come in without entering file name. in case batch file exits.

next batch code checks if name of html file entered ".html" @ end. file extension automatically added batch code (for unknown reason), string ".html" removed name of file.

it happen 1 time 1 time again remaining string empty string.

last batch file checks if file name absolute or relative path can found @ in file system. otherwise , error message output.

please note batch file cannot evaluate web pages using http (hyper text transfer protocol) or other protocols accessing files in www. can used files on local drives, network drives or public shares via unc path.

all references environment variable htmlfile enclosed in double quotes required in case of space or other special characters nowadays in file name (with or without path) entered batch file user.

batch-file

Comments

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -