简体   繁体   English

如何关闭从命令行使用.hta打开的窗口? (不是手动的)

[英]How do I close a window that was opened with a .hta from the command line? (not manually)

Say I give the command test.hta 说我给命令test.hta

A window pops up displaying the page. 弹出一个窗口显示页面。 How do I close that window from the command line? 如何从命令行关闭该窗口? I can't do it manually because I'm not present. 我不在场,因此无法手动执行。 It's a batch script running. 这是一个正在运行的批处理脚本。

The commenter above helped me solve the issue. 上面的评论者帮助我解决了这个问题。 It can be done by the jscript code in the .hta file. 可以通过.hta文件中的jscript代码完成。 Here is the pattern: 这是模式:

<html>
<head>
<script type="text/javascript">
    function myclose()
    {
        close();
    }
    setTimeout(myclose, 3000);
</script>
</head>
<body>
The Sun is shining down on you today :)
</body>
</html>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何关闭从命令行创建的文件? - How do I close a file created from command line? 从命令行关闭窗口(在Windows上) - Close window from command line (on windows) 从命令行运行 m 文件时如何隐藏“MATLAB 命令行窗口”? - How do I hide “MATLAB Command Window” when I run an m-file from command line? 如何关闭Windows 7中打开的端口? - How do i close an opened port in Windows 7? 我如何查找 swing 上是否打开了 window - How do i find if a window is opened on swing 如何关闭从visual studio中打开的“孤立”控制台窗口? - How to close an “orphaned” console window that was opened from within visual studio? 如何在不打开新 cmd 窗口的情况下从命令行启动程序? - How do I launch a program from command line without opening a new cmd window? 如何从sh脚本打开新的命令行窗口,然后传入多个命令 - How do I open a new command line window from an sh script and then pass in multiple commands 如何在卸载主窗口时关闭从主窗口的iframe打开的窗口 - How to close windows that was opened from iframe of main window on unload of main window 关闭应用程序窗口而不终止命令行 - Close an application window without terminating in Command Line
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM