A couple of Windows batch files.
Because sometimes while I’m at a Windows Console, I’m still thinking UNIX commands.
Launching a graphical executable from the command line
vi.bat
@echo off
start "title" /b "C:\Program Files\Vim\vim70\gvim.exe" %*
Locating the executable in the classpath
which.bat
@ECHO OFF
setlocal
set DELAY=YES
set DELAY=!DELAY!if "%DELAY%" == "YES" (
set files=
for %%i in (%PATHEXT%) DO set files=!files!;%1%%i
for %%i in (!files!) DO if EXIST %%~$PATH:i (@echo.%%~$PATH:i)
) else (
if "%2" == "with_delay" (
echo Invalid state. Prevent infinite recursion
) else (
cmd /v:on /c which.bat %1 with_delay
)
)
endlocal
Links
Batch Reference
Command Line Reference
One Comment
which.bat is slick! Thanks for sharing!
Post a Comment