I have a batch file (.bat) and I want to convert it to .cmd file:
rem^ &@echo off
rem^ &call :'sub
rem^ &exit /b
:'sub
rem^ &echo begin batch
rem^ &cscript //nologo //e:vbscript "%~f0"
rem^ &echo end batch
rem^ &exit /b
I have a batch file (.bat) and I want to convert it to .cmd file:
rem^ &@echo off
rem^ &call :'sub
rem^ &exit /b
:'sub
rem^ &echo begin batch
rem^ &cscript //nologo //e:vbscript "%~f0"
rem^ &echo end batch
rem^ &exit /b
convertBatToCmd.bat
:
@echo off
echo ConvertBatToCmd.bat
if not exist "%1" echo call with file to be converted as parameter & goto :eof
ren "%1" "%~n1.cmd"
Usage: convertBatToCmd myfile.bat
(sorry, couldn't resist...)
back to seriousity: more infos here