Skip to content

Instantly share code, notes, and snippets.

@Archigos
Created July 29, 2014 15:27
Show Gist options
  • Save Archigos/61c9e5a64e2fb41cb5f5 to your computer and use it in GitHub Desktop.
Save Archigos/61c9e5a64e2fb41cb5f5 to your computer and use it in GitHub Desktop.
Get some basic information about a file
@ECHO OFF && SETLOCAL ENABLEEXTENSIONS && SETLOCAL ENABLEDELAYEDEXPANSION
TITLE %COMSPEC% && MODE CON COLS=200 LINES=68 && COLOR 07
PUSHD . && CLS
:: Test for Admin (Uncomment if you require them)
REM OPENFILES >NUL || ECHO Administrative Privileges Required
IF "%~1" == "/?" GOTO Help ELSE GOTO Beginning
IF "%~1" == "" GOTO Help
:Beginning
FOR %%? IN ("%~1") DO (
ECHO.
ECHO File Name Only : %%~n?
ECHO File Extension : %%~x?
ECHO Name in 8.3 notation : %%~sn?
ECHO File Attributes : %%~a?
ECHO Located on Drive : %%~d?
ECHO File Size : %%~z?
ECHO Last-Modified Date : %%~t?
ECHO Parent Folder : %%~dp?
ECHO Fully Qualified Path : %%~f?
ECHO FQP in 8.3 notation : %%~sf?
ECHO Location in the PATH : %%~dp$PATH:?
)
GOTO EOF
:Help
ECHO.
ECHO You need to include the file name to be checked:
ECHO Example: checkfile index.php
GOTO EOF
:EOF
POPD
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment