@echo off :: filename: whatruns.btm :: author: Eric Pement :: date: 2012-01-06 15:18:33 :: if "%1" == "/?" .OR. "%1" == "--help" goto syntax if "%1" == "" goto nopath if NOT ISDIR %1 goto nopath echo Executable files in %@full[%1\*.*] (sorted by file extension): echo. :: SETDOS options: :: /X-5 disables multiple commands, conditional commands, and piping (affects the :: command separator, ||, &&, |, and |&) setdos /X-5 :: DIR opts: /4 = 4-column, kilobyte display :: /k = no header /v = vertical sort :: /o:e = sort by filetype /ne = no error if no files found :: /m = no summary footer dir %1\*.bat;*.cmd;*.btm;*.com;*.exe;*.pl;*.awk;*.sh;*.ksh;*.ad[ep];*.cpl;*.hta;*.ins;*.isp;*.ms[cipt];*.sc[rt];*.vb;*.vb[es];*.ws[cfh] /4kmvp /ne /o:e %2$ setdos /X+5 goto end :nopath echo Executable files in %_CWD (sorted by file extension): echo. setdos /X-5 :: OLD-- dir *.bat;*.btm;*.cmd;*.com;*.exe;*.msc;*.pl;*.awk /4kmvp /o:e %$ :: Windows EnvironmentVariable PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC dir %@replace[.,*.,%PATHEXT%];*.pl;*.awk;*.py;*.sh;*.ksh;*.ad[ep];*.cpl;*.hta;*.ins;*.isp;*.ms[ipt];*.sc[rt];*.vb;*.wsc /4kmvp /ne /o:e %$ setdos /X+5 goto end :syntax TEXT Usage: whatruns [directory] [/TakeCommand options] WHATRUNS accepts directory names and options appropriate for DIR. It displays a list of executable files, matching any of these filetypes: bat,cmd,btm DOS batch files, TakeCommand/JPSoft batch file com,exe binary executables pl,awk,py perl, awk, python scripts sh,ksh Bourne shell script, Korn shell script ade,adp Microsoft Access Database (extension, project) cpl Control Panel Extension hta Hypertext Application ins,isp IIS Network Settings script, IIS Service Provider script jse JScript Encoded script msc,msi,msp,mst Microsoft (CommonConsole,installer,patch,visual Test) scr,sct Windows Screen Saver, Windows Script Component vb,vbe,vbs Visual Basic (encoded, script) wsc,wsf,wsh Windows Scripting (component, file, host) Default executable extensions are defined by the environment variable %PATHEXT%. ENDTEXT echo Currently, PATHEXT=%PATHEXT% TEXT The following exectuable extensions are automatically BLOCKED by gmail.com, and may not be sent, even in an archive (.zip, .tar, .tgz, .taz, .z, .gz): "ade", "adp", "bat", "chm", "cmd", "com", "cpl", "exe", "hta", "ins", "isp", "jse", "lib", "mde", "msc", "msp", "mst", "pif", "scr", "sct", "shb", "sys", "vb", "vbe", "vbs", "vxd", "wsc", "wsf", "wsh" ENDTEXT :end