CODE: [Copy to clipboard]
:: BatDump.bat - V2 - Dump process of batch program
:: Will Sort - 2005-12-06 - CMD@WinXP/MSDOS7.10/MSDOS6.22
@echo off
if not "%1"=="" if exist %1.bat goto Dump
:Usage
echo.
echo BatDump - Dump process of batch program
echo Usage: %0 batname(without extname)
echo Sample: %0 test
echo.
goto end
:Dump
ren %1.bat %1.bak
echo @echo off>%1.bat
echo set prompt=# >>%1.bat
echo echo on>> %1.bat
find /v "echo off" < %1.bak >> %1.bat
shift
%comspec% /c %0 %1 %2 %3 %4 %5 %6 %7 %8 %9 | find "#"
if exist %0.bat del %0.bat
ren %0.bak %0.bat
:end