/**
* @param cmdStr
* @return
*/
public static void exec(String cmdStr)throws IOException {
//�����ʽ��ִ�е�exe Ŀ¼ ��"cmd.exe"," dir"
// String cmd = "cmd /c start C:/WSCA-ENU-06-12/setpassword.bat";
String cmd="cmd /c start "+cmdStr;
Process ps = Runtime.getRuntime().exec(cmd);
System.out.print(loadStream(ps.getInputStream()));
System.err.print(loadStream(ps.getErrorStream()));
}
------------------------------------------------------------------------------------------------------
import.cmd
set path=d:/axonsams.sql
set path="C:\Program Files\MySQL\MySQL Server 5.0\bin"
@ECHO OFF
CLS
ECHO.
ECHO.
ECHO.
ECHO 进入Mysql目录....
ECHO
pause
ECHO 数据库正在执行中....
mysql --host=localhost --user=root --password=liming -D mysql <%sql%
ECHO.
ECHO 数据库执行完毕
ECHO.
pause
exit
------------------------------------------------------------------------------------------------------
export.bat
set path="C:\Program Files\MySQL\MySQL Server 5.0\bin"
@ECHO OFF
CLS
ECHO.
ECHO.
ECHO.
ECHO 进入Mysql目录....
ECHO.
ECHO.
ECHO 数据库正在保存中....
mysqldump --host=localhost --user=root --password=liming axonsams>d:\axonsams%DATE:~0,4%%DATE:~5,2%%DATE:~8,2%.sql
ECHO.
ECHO.
ECHO 数据库保存路径为ID:\axonsams%DATE:~0,4%%DATE:~5,2%%DATE:~8,2%.sql
ECHO.
ECHO.
exit