I want to know whether my host file has access to EDIT or not using errorcode but i am always getting error code as 0..Please help me out in getting the code to check for a admin access for a particular specified file
I am using below code, but not working
@echo off
setlocal enabledelayedexpansion enableextensions
attrib -s -h -r %systemroot%\system32\drivers\etc\hosts
echo %errorlevel%
echo.
IF %errorlevel% NEQ 0 (
echo.
echo Do not have access..
pause >nul
exit
) else (
echo Has Access..
pause >nul
)