Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/85.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在批处理文件运行时在HTML文件中显示进度条_Html_Batch File_Progress Bar - Fatal编程技术网

如何在批处理文件运行时在HTML文件中显示进度条

如何在批处理文件运行时在HTML文件中显示进度条,html,batch-file,progress-bar,Html,Batch File,Progress Bar,我已经编写了一个Servlet来运行bat文件。此bat文件从指定路径复制内容,然后重新启动服务器。我想在html页面中向最终用户显示进度条,即批处理文件进度,即,进度条应在文件复制时进行,并应显示复制完成后服务器启动并重新启动服务器 这是我的密码: protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

我已经编写了一个
Servlet
来运行bat文件。此bat文件从指定路径复制内容,然后重新启动服务器。我想在html页面中向最终用户显示进度条,即批处理文件进度,即,进度条应在文件复制时进行,并应显示复制完成后服务器启动并重新启动服务器

这是我的密码:

protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        System.out.println("DoPost is Invoked");
        String buildPath = request.getParameter("buildPath");
        System.out.println(buildPath);
        try {
            File file = new File("C:/Users/Hrushi/Desktop/Html/BuildPath.txt");
            FileWriter fileWriter = new FileWriter(file);
            fileWriter.write(buildPath);
            fileWriter.flush();
            fileWriter.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
        Runtime.getRuntime().exec("cmd /c start C:/Users/Hrushi/Desktop/Helllo/hello.bat");
        response.setContentType("text/html");
        PrintWriter out = response.getWriter();
        out.println("");
}

看看这个例子,用vbscript和HTA==>创建一个进度条看看这个例子,用vbscript和HTA==>