:init
setlocal DisableDelayedExpansion
set "batchPath=%~0"
for %%k in (%0) do set batchName=%%~nk
set "vbsGetPrivileges=%temp%\OEgetPriv_%batchName%.vbs"
setlocal EnableDelayedExpansion
:checkPrivileges
NET FILE 1>NUL 2>NUL
if '%errorlevel%' == '0' ( goto gotPrivileges ) else ( goto getPrivileges )
MODE CON: COLS=56 LINES=23
TITLE 正在加载EXE文件
CLS
:MAIN
:: 重置变量
SET EXE_DISK=
SET EXENAMEEXA=
SET EXENAMEEXB=
SET NAMESEX=
SET FULLNAME=
SET EX=
:: 当前时间
SET tm1=%time:~0,2%
SET tm2=%time:~3,2%
SET tm3=%time:~6,2%
:: #########################################################################################
:: 获取操作信息
if "%1"=="" GOTO :HELP_EXE
if "%1"=="%~0" GOTO :LOAD_EXE
if "%1"=="%~dp0%~n0%~x0" GOTO :LOAD_EXE
:LOAD_EXE
:: 得到文件路径完整信息
SET EXE_PATH=%1
GOTO SLOAD_EXE
:SLOAD_EXE
:: 获取EXE文件的路径名称等信息
for /f "delims==" %%i in ("%EXE_PATH%") Do (
SET "EXE_DISK=%%~di"
SET "EXENAMEEXA=%%~ni"
SET "EXENAMEEXB=%%~nxi"
SET "NAMESEX=%%~pi%%~nxi"
SET "FULLNAME=%%~dpi%%~nxi"
SET "EX=%%~xi"
)
if /i "%EX%" == ".EXE" (ECHO.&ECHO.正在加载 %EXE_PATH% …) ELSE GOTO :NO_EXE