@echo off
SET TargetDirectory=C:\Windows\SysWow64\cscript.exe
chcp 65001 & echo Upbatch:----------------------Start----------------------  >> "%~dp0\yprverapp" & chcp 932
IF EXIST %TargetDirectory% (
chcp 65001 & C:\Windows\SysWow64\cscript.exe "%~dp0\sqlcmd.vbs" %1 >> "%~dp0\yprverapp" & chcp 932
) ELSE (
chcp 65001 & cscript "%~dp0\sqlcmd.vbs" %1 >> "%~dp0\yprverapp" & chcp 932
)
chcp 65001 & echo Upbatch:----------------------End  ----------------------  >> "%~dp0\yprverapp" & chcp 932
del "%~dp0\mscript.sql"
del "%~dp0\mscript01.sql"
del "%~dp0\mscript02.sql"
del "%~dp0\mscript03.sql"
del "%~dp0\sscript.sql"
del "%~dp0\sqlcmd.vbs"
