i have a batch file that needs to apply the attrib +h command to a file, then output to a txt file and display contents on screen. This should also be done if file has not been provided or can not be found. I have this so far but can not get it to work:
:TOP
IF EXIST "%1" GOTO COMMAND
) ELSE
(
GOTO ERROR1
:COMMAND
attrib +h %1
SHIFT
GOTO TOP
GOTO END
:ERROR1
IF "%1"=="" GOTO ERROR2
) ELSE
(
GOTO ERROR3
:ERROR2
ECHO.
ECHO No file(s) provided. Please re run the batch file.
GOTO END
:ERROR3
ECHO.
ECHO The file was not found. Please re run the batch file.
GOTO END
:END
This is my first computer course and any help will be greatly appreciated. Thank you.