hta 相关问题

HTML应用程序(HTA)是Microsoft Windows程序,其源代码由HTML,动态HTML和Internet Explorer支持的一种或多种脚本语言(如VBScript或JScript)组成。如果您的问题是关于HTA中的脚本,请始终提及或添加使用的脚本语言的标记。

将cmd数据显示到HTA和命令提示符窗口中

我遇到了一个问题,试图摆脱cmd弹出窗口并使命令中的所有数据出现在span标签中。我知道足以让命令正常工作,但不知道如何实现

回答 1 投票 0

获取HTA中某个目录的路径

我希望用户通过创建的输入标签提供文件夹或目录的路径,如下所示: var newinput = document.createElement('input'); newinput.type = "文件"; 新输入。

回答 1 投票 0

获取html中某个目录的路径

我希望用户通过创建的输入标签提供文件夹或目录的路径,如下所示: var newinput = document.createElement('input'); newinput.type = "文件"; 新输入。

回答 1 投票 0

修改GIF文件夹预览脚本

也许这里有人可以帮我修改这个脚本吗?我希望文件名位于 gif 下方,并且文本大小稍小一些,以便更多的 gif 可以出现在一行中。 <p>也许这里有人可以帮我修改这个脚本吗?我希望文件名位于 gif 下方,并且文本大小稍小一些,以便更多的 gif 可以出现在一行中。</p> <pre><code>&lt;script type=&#34;text/vbs&#34;&gt; set fso=CreateObject(&#34;Scripting.FileSystemObject&#34;) set fldr=fso.GetFolder(&#34;.&#34;) for each file in fldr.files if lcase(right(file.name,4))=&#34;.gif&#34; then document.write &#34;&lt;img src=&#34;&#34;&#34; &amp; file.name &amp; &#34;&#34;&#34;&gt;&#34; document.write file.name &amp; &#34;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&#34; end if next &lt;/script&gt; </code></pre> </question> <answer tick="false" vote="0"> <p>如评论中所述,您可以使用一些应用于 Div 的 CSS 并创建一个类来设置图像大小。大小可以指定为任何所需的单位。这里使用 Ems 是因为在设置不同缩放值的显示器上尺寸保持相当恒定。这是 HTA 代码:</p> <p><strong>GIFshow.hta</strong></p> <pre><code>&lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;meta http-equiv=&#34;x-ua-compatible&#34; content=&#34;IE=10&#34;&gt; &lt;script language=&#34;VBScript&#34;&gt; Set oFSO = CreateObject(&#34;Scripting.FileSystemObject&#34;) Set oFolder = oFSO.GetFolder(&#34;.&#34;) For Each oFile In oFolder.Files If LCase(oFSO.GetExtensionName(oFile.Name)) = &#34;gif&#34; Then document.write &#34;&lt;div class=&#34;&#34;image-container&#34;&#34;&gt;&#34; document.write &#34;&lt;img class=&#34;&#34;image&#34;&#34; src=&#34;&#34;&#34; &amp; oFile.Name &amp; &#34;&#34;&#34; alt=&#34;&#34;&#34; &amp; oFile.Name &amp; &#34;&#34;&#34;&gt;&#34; document.write &#34;&lt;br&gt;&#34; &amp; oFile.Name document.write &#34;&lt;/div&gt;&#34; End If Next &lt;/script&gt; &lt;style&gt; .image-container { display: inline-block; text-align: center; } .image { width: 10em; height: 10em; } &lt;/style&gt; &lt;/head&gt; &lt;body&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> </answer> </body></html>

回答 0 投票 0

如何浏览文件(Win7/64位)

我需要通过命令行应用程序快速编写一个简单的 GUI。需要两个步骤: 指定输入文件路径, 指定输出文件路径(不存在) 我发现了以前的帖子,h...

回答 3 投票 0

BAT/HTA 混合 - 如何转义 HTML 部分中的百分号?

我正在处理批处理/HTA 混合文件,并希望向应用程序添加一些背景音乐。当我尝试将 url(包含百分号)添加到 标签时,它不会播放任何内容...

回答 1 投票 0

HTA VBScript:在运行时从字符串或包含字符串的变量动态创建函数,如 Javascript 中使用 new Function() 构造函数

我正在尝试学习更多的 hta 和 VBScript,我想知道 VBS 是否允许像 Javascript 中那样创建动态函数: var f = new Function('函数名', 函数体); 或者 赢...

回答 0 投票 0

将 hta 窗口居中

如何将 HTA 窗口居中,使其位于屏幕中央,无论 HTA 大小的屏幕分辨率如何我有这个: Sub DoResize '不要使用 </desc> <question vote="8"> <p>如何将 HTA 窗口居中,使其位于屏幕中央,无论 HTA 大小的屏幕分辨率如何我有这个:</p> <pre><code>&lt;/head&gt; &lt;script&gt; Sub DoResize &#39;Do not use Window_Onload window.resizeTo 800,600 strComputer = &#34;.&#34; Set objWMIService = GetObject(&#34;Winmgmts:\\&#34; &amp; strComputer &amp; &#34;\root\cimv2&#34;) Set colItems = objWMIService.ExecQuery(&#34;Select * From Win32_DesktopMonitor&#34;) For Each objItem in colItems intHorizontal = objItem.ScreenWidth intVertical = objItem.ScreenHeight Next intLeft = (intHorizontal - 800) / 2 intTop = (intVertical - 600) / 2 window.moveTo intLeft, intTop End Sub DoResize() &#39;Run the subroutine to position the containing window (your HTA dialog) before the body is rendered. &lt;/script&gt; &lt;body&gt; </code></pre> <p>但是如果我更改屏幕分辨率,它就不起作用,并且会调整 HTA 窗口的大小。</p> <p>问题:无论屏幕分辨率的 HTA 大小如何,如何将 HTA 移动到屏幕中央。</p> </question> <answer tick="true" vote="6"> <p>为此使用 WMI 有点过分了。您可以使用 <pre><code>screen</code></pre> 对象代替:</p> <pre><code>window.resizeTo (800, 600); window.moveTo((screen.width - 800) / 2, (screen.height - 600) / 2); </code></pre> <p>如果您想在开始时调整窗口大小,请将上面的行放在 <pre><code>script</code></pre> 部分中的 (JS) <pre><code>head</code></pre> 标记中,甚至在 <pre><code>&lt;hta: application&gt;</code></pre> 标记之前,或者在事件处理程序中或任何位置使用代码需要它。</p> <p>如果您想将任务栏的高度排除在居中区域之外,可以使用 <pre><code>screen.availHeight</code></pre> 代替 <pre><code>screen.height</code></pre>。</p> </answer> <answer tick="false" vote="2"> <pre><code>var winWidth = 800, winHeight = 600; window.resizeTo(winWidth, winHeight); window.moveTo((screen.width - winWidth) / 2, (screen.height - winHeight) / 2); </code></pre> </answer> <answer tick="false" vote="0"> <p>HTA窗口</p> <blockquote> <p>`</p> </blockquote> <p></p><div data-babel="false" data-lang="js" data-hide="false" data-console="true"> <div> <pre><code>&lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;title&gt;File Operations&lt;/title&gt; &lt;hta:application id=&#34;FileOperationsHTA&#34; applicationname=&#34;FileOperationsHTA&#34; singleinstance=&#34;yes&#34; maximizebutton=&#34;no&#34; minimizebutton=&#34;no&#34; windowstate=&#34;normal&#34; scroll=&#34;no&#34; navigable=&#34;yes&#34; showintaskbar=&#34;no&#34; contextmenu=&#34;no&#34; selection=&#34;no&#34; /&gt; &lt;/head&gt; &lt;body onload=&#34;showFields()&#34;&gt; &lt;h1&gt;File Operations&lt;/h1&gt; &lt;label for=&#34;operationCombo&#34;&gt;Select operation:&lt;/label&gt; &lt;select id=&#34;operationCombo&#34; onchange=&#34;showFields()&#34;&gt; &lt;option value=&#34;&#34;&gt;Select an operation&lt;/option&gt; &lt;option value=&#34;move&#34;&gt;Move&lt;/option&gt; &lt;option value=&#34;copy&#34;&gt;Copy&lt;/option&gt; &lt;option value=&#34;delete&#34;&gt;Delete&lt;/option&gt; &lt;option value=&#34;newfolder&#34;&gt;New Folder&lt;/option&gt; &lt;option value=&#34;rename&#34;&gt;Rename&lt;/option&gt; &lt;/select&gt; &lt;div id=&#34;sourceField&#34; style=&#34;display: none;&#34;&gt; &lt;label for=&#34;sourcePath&#34;&gt;Source path:&lt;/label&gt; &lt;input type=&#34;text&#34; id=&#34;sourcePath&#34; /&gt; &lt;/div&gt; &lt;div id=&#34;destinationField&#34; style=&#34;display: none;&#34;&gt; &lt;label for=&#34;destinationPath&#34;&gt;Destination path:&lt;/label&gt; &lt;input type=&#34;text&#34; id=&#34;destinationPath&#34; /&gt; &lt;/div&gt; &lt;div id=&#34;deleteField&#34; style=&#34;display: none;&#34;&gt; &lt;label for=&#34;deletePath&#34;&gt;File/Folder to delete:&lt;/label&gt; &lt;input type=&#34;text&#34; id=&#34;deletePath&#34; /&gt; &lt;/div&gt; &lt;div id=&#34;newFolderField&#34; style=&#34;display: none;&#34;&gt; &lt;label for=&#34;parentPath&#34;&gt;Parent path for new folder:&lt;/label&gt; &lt;input type=&#34;text&#34; id=&#34;parentPath&#34; /&gt; &lt;label for=&#34;newFolderName&#34;&gt;New folder name:&lt;/label&gt; &lt;input type=&#34;text&#34; id=&#34;newFolderName&#34; /&gt; &lt;/div&gt; &lt;div id=&#34;renameField&#34; style=&#34;display: none;&#34;&gt; &lt;label for=&#34;sourcePathRename&#34;&gt;Source path:&lt;/label&gt; &lt;input type=&#34;text&#34; id=&#34;sourcePathRename&#34; /&gt; &lt;label for=&#34;destinationPathRename&#34;&gt;Destination path:&lt;/label&gt; &lt;input type=&#34;text&#34; id=&#34;destinationPathRename&#34; /&gt; &lt;label for=&#34;newFileName&#34;&gt;New filename:&lt;/label&gt; &lt;input type=&#34;text&#34; id=&#34;newFileName&#34; /&gt; &lt;/div&gt; &lt;button id=&#34;executeButton&#34; onclick=&#34;executeOperation()&#34;&gt;Execute&lt;/button&gt; &lt;script type=&#34;text/javascript&#34;&gt; function showFields() { var operation = document.getElementById(&#39;operationCombo&#39;).value; var sourceField = document.getElementById(&#39;sourceField&#39;); var destinationField = document.getElementById(&#39;destinationField&#39;); var deleteField = document.getElementById(&#39;deleteField&#39;); var newFolderField = document.getElementById(&#39;newFolderField&#39;); var renameField = document.getElementById(&#39;renameField&#39;); var executeButton = document.getElementById(&#39;executeButton&#39;); sourceField.style.display = &#39;none&#39;; destinationField.style.display = &#39;none&#39;; deleteField.style.display = &#39;none&#39;; newFolderField.style.display = &#39;none&#39;; renameField.style.display = &#39;none&#39;; switch (operation) { case &#39;move&#39;: sourceField.style.display = &#39;block&#39;; destinationField.style.display = &#39;block&#39;; break; case &#39;copy&#39;: sourceField.style.display = &#39;block&#39;; destinationField.style.display = &#39;block&#39;; break; case &#39;delete&#39;: deleteField.style.display = &#39;block&#39;; break; case &#39;newfolder&#39;: newFolderField.style.display = &#39;block&#39;; break; case &#39;rename&#39;: renameField.style.display = &#39;block&#39;; document.getElementById(&#39;sourcePathRename&#39;).disabled = false; document.getElementById(&#39;destinationPathRename&#39;).disabled = false; document.getElementById(&#39;newFileName&#39;).disabled = false; break; } } function executeOperation() { var operation = document.getElementById(&#39;operationCombo&#39;).value; switch (operation) { case &#39;move&#39;: var sourcePath = document.getElementById(&#39;sourcePath&#39;).value; var destinationPath = document.getElementById(&#39;destinationPath&#39;).value; moveFilesWithWildcard(sourcePath, destinationPath); break; case &#39;copy&#39;: var sourcePath = document.getElementById(&#39;sourcePath&#39;).value; var destinationPath = document.getElementById(&#39;destinationPath&#39;).value; copyFilesWithWildcard(sourcePath, destinationPath); break; case &#39;delete&#39;: var deletePath = document.getElementById(&#39;deletePath&#39;).value; deleteFilesWithWildcard(deletePath); break; case &#39;newfolder&#39;: var parentPath = document.getElementById(&#39;parentPath&#39;).value; var newFolderName = document.getElementById(&#39;newFolderName&#39;).value; createNewFolder(parentPath, newFolderName); break; case &#39;rename&#39;: var sourcePathRename = document.getElementById(&#39;sourcePathRename&#39;).value; var destinationPathRename = document.getElementById(&#39;destinationPathRename&#39;).value; var newFileName = document.getElementById(&#39;newFileName&#39;).value; renameFile(sourcePathRename, destinationPathRename, newFileName); break; } } function renameFile(sourcePath, destinationPath, newFileName) { var fso = new ActiveXObject(&#34;Scripting.FileSystemObject&#34;); if (fso.FileExists(sourcePath)) { try { fso.MoveFile(sourcePath, fso.BuildPath(destinationPath, newFileName)); alert(&#39;Rename operation executed.\nSource: &#39; + sourcePath + &#39;\nDestination: &#39; + destinationPath); } catch (e) { alert(&#39;Error renaming file: &#39; + e.message); } } else { alert(&#39;Source file not found.&#39;); } } function moveFilesWithWildcard(sourcePath, destinationPath) { var fso = new ActiveXObject(&#34;Scripting.FileSystemObject&#34;); var parentFolder = fso.GetParentFolderName(sourcePath); var wildcard = fso.GetFileName(sourcePath); var parentFolderObj = fso.GetFolder(parentFolder); if (fso.FolderExists(parentFolder)) { try { var files = new Enumerator(parentFolderObj.Files); var subFolders = new Enumerator(parentFolderObj.SubFolders); var regex = new RegExp(wildcard.replace(/\./g, &#34;\\.&#34;).replace(/\*/g, &#34;.*&#34;), &#34;i&#34;); for (; !files.atEnd(); files.moveNext()) { var file = files.item(); if (regex.test(file.Name)) { var sourceFile = fso.BuildPath(parentFolder, file.Name); var destinationFile = fso.BuildPath(destinationPath, file.Name); fso.MoveFile(sourceFile, destinationFile); } } for (; !subFolders.atEnd(); subFolders.moveNext()) { var subFolder = subFolders.item(); if (regex.test(subFolder.Name)) { var newDestPath = fso.BuildPath(destinationPath, subFolder.Name); fso.CreateFolder(newDestPath); moveFilesRecursive(subFolder, newDestPath); } } } catch (e) { alert(&#39;Error moving files/folders with wildcard.&#39;); } } else { alert(&#39;Parent path not found.&#39;); } } function moveFilesRecursive(folder, destinationPath) { var fso = new ActiveXObject(&#34;Scripting.FileSystemObject&#34;); var files = new Enumerator(folder.Files); var subFolders = new Enumerator(folder.SubFolders); for (; !files.atEnd(); files.moveNext()) { var file = files.item(); var destinationFile = fso.BuildPath(destinationPath, file.Name); fso.MoveFile(file.Path, destinationFile); } for (; !subFolders.atEnd(); subFolders.moveNext()) { var subFolder = subFolders.item(); var newDestPath = fso.BuildPath(destinationPath, subFolder.Name); fso.CreateFolder(newDestPath); moveFilesRecursive(subFolder, newDestPath); } } function copyFiles(sourcePath, destinationPath) { var fso = new ActiveXObject(&#34;Scripting.FileSystemObject&#34;); var folder = fso.GetFolder(sourcePath); if (fso.FolderExists(destinationPath)) { try { copyFilesRecursive(folder, destinationPath); alert(&#39;Copy operation executed.\nSource Path: &#39; + sourcePath + &#39;\nDestination Path: &#39; + destinationPath); } catch (e) { alert(&#39;Error copying files/folders.&#39;); } } else { alert(&#39;Destination path not found.&#39;); } } function copyFilesRecursive(folder, destinationPath) { var fso = new ActiveXObject(&#34;Scripting.FileSystemObject&#34;); var files = new Enumerator(folder.Files); var subFolders = new Enumerator(folder.SubFolders); for (; !files.atEnd(); files.moveNext()) { var file = files.item(); fso.CopyFile(file.Path, fso.BuildPath(destinationPath, file.Name), true); } for (; !subFolders.atEnd(); subFolders.moveNext()) { var subFolder = subFolders.item(); var newDestPath = fso.BuildPath(destinationPath, subFolder.Name); fso.CreateFolder(newDestPath); copyFilesRecursive(subFolder, newDestPath); } } function moveFilesWithWildcard(sourcePath, destinationPath) { var fso = new ActiveXObject(&#34;Scripting.FileSystemObject&#34;); var parentFolder = fso.GetParentFolderName(sourcePath); var wildcard = fso.GetFileName(sourcePath); var parentFolderObj = fso.GetFolder(parentFolder); if (fso.FolderExists(parentFolder)) { try { var files = new Enumerator(parentFolderObj.Files); var subFolders = new Enumerator(parentFolderObj.SubFolders); var regex = new RegExp(wildcard.replace(/\./g, &#34;\\.&#34;).replace(/\*/g, &#34;.*&#34;), &#34;i&#34;); for (; !files.atEnd(); files.moveNext()) { var file = files.item(); if (regex.test(file.Name)) { var sourceFile = fso.BuildPath(parentFolder, file.Name); var destinationFile = fso.BuildPath(destinationPath, file.Name); fso.MoveFile(sourceFile, destinationFile); } } for (; !subFolders.atEnd(); subFolders.moveNext()) { var subFolder = subFolders.item(); if (regex.test(subFolder.Name)) { var newDestPath = fso.BuildPath(destinationPath, subFolder.Name); fso.CreateFolder(newDestPath); moveFilesRecursive(subFolder, newDestPath); } } } catch (e) { alert(&#39;Error moving files/folders with wildcard.&#39;); } } else { alert(&#39;Parent path not found.&#39;); } } function moveFilesRecursive(folder, destinationPath) { var fso = new ActiveXObject(&#34;Scripting.FileSystemObject&#34;); var files = new Enumerator(folder.Files); var subFolders = new Enumerator(folder.SubFolders); for (; !files.atEnd(); files.moveNext()) { var file = files.item(); var destinationFile = fso.BuildPath(destinationPath, file.Name); fso.MoveFile(file.Path, destinationFile); } for (; !subFolders.atEnd(); subFolders.moveNext()) { var subFolder = subFolders.item(); var newDestPath = fso.BuildPath(destinationPath, subFolder.Name); fso.CreateFolder(newDestPath); moveFilesRecursive(subFolder, newDestPath); } } function copyFilesWithWildcard(sourcePath, destinationPath) { var fso = new ActiveXObject(&#34;Scripting.FileSystemObject&#34;); if (fso.FileExists(sourcePath)) { // Source path is a single file var sourceFolder = fso.GetParentFolderName(sourcePath); var sourceFileName = fso.GetFileName(sourcePath); if (fso.FileExists(destinationPath)) { // Destination path includes a filename, create a new folder in the destination path var destinationParentFolder = fso.GetParentFolderName(destinationPath); var newFolderName = fso.GetBaseName(destinationPath); destinationPath = fso.BuildPath(destinationParentFolder, newFolderName); } else if (!fso.FolderExists(destinationPath)) { // Destination folder does not exist, create it fso.CreateFolder(destinationPath); } // Perform the copy operation fso.CopyFile(sourcePath, fso.BuildPath(destinationPath, sourceFileName)); alert(&#39;Copy operation executed.\nSource: &#39; + sourcePath + &#39;\nDestination: &#39; + destinationPath); } else if (fso.FolderExists(sourcePath)) { // Source path is a folder var parentFolder = fso.GetParentFolderName(sourcePath); var wildcard = fso.GetFileName(sourcePath); var parentFolderObj = fso.GetFolder(parentFolder); if (fso.FolderExists(parentFolder)) { try { var files = new Enumerator(parentFolderObj.Files); var subFolders = new Enumerator(parentFolderObj.SubFolders); var regex = new RegExp(wildcard.replace(/\./g, &#34;\\.&#34;).replace(/\*/g, &#34;.*&#34;), &#34;i&#34;); // Collect files and folders matching the wildcard var filesToCopy = []; var foldersToCopy = []; for (; !files.atEnd(); files.moveNext()) { var file = files.item(); if (regex.test(file.Name)) { filesToCopy.push(file); } } for (; !subFolders.atEnd(); subFolders.moveNext()) { var subFolder = subFolders.item(); if (regex.test(subFolder.Name)) { foldersToCopy.push(subFolder); } } // Perform the copy operation if (!fso.FolderExists(destinationPath)) { // Destination folder does not exist, create it fso.CreateFolder(destinationPath); } for (var i = 0; i &lt; filesToCopy.length; i++) { var file = filesToCopy[i]; file.Copy(fso.BuildPath(destinationPath, file.Name)); } for (var i = 0; i &lt; foldersToCopy.length; i++) { var folder = foldersToCopy[i]; copyFolderRecursive(folder, fso.BuildPath(destinationPath, folder.Name)); } alert(&#39;Copy operation executed.\nSource: &#39; + sourcePath + &#39;\nDestination: &#39; + destinationPath); } catch (e) { alert(&#39;Error copying files/folders with wildcard: &#39; + e.message); } } else { alert(&#39;Source parent path not found.&#39;); } } else { alert(&#39;Source path not found.&#39;); } } function copyFolderRecursive(sourceFolder, destinationFolder) { var fso = new ActiveXObject(&#34;Scripting.FileSystemObject&#34;); fso.CreateFolder(destinationFolder); var files = new Enumerator(sourceFolder.Files); var subFolders = new Enumerator(sourceFolder.SubFolders); for (; !files.atEnd(); files.moveNext()) { var file = files.item(); file.Copy(fso.BuildPath(destinationFolder, file.Name)); } for (; !subFolders.atEnd(); subFolders.moveNext()) { var subFolder = subFolders.item(); copyFolderRecursive(subFolder, fso.BuildPath(destinationFolder, subFolder.Name)); } } function createNewFolder(parentPath, newFolderName) { var fso = new ActiveXObject(&#34;Scripting.FileSystemObject&#34;); var fullPath = fso.BuildPath(parentPath, newFolderName); try { fso.CreateFolder(fullPath); alert(&#39;New folder created successfully.\nPath: &#39; + fullPath); } catch (e) { alert(&#39;Error creating new folder: &#39; + e.message); } } function deleteFilesWithWildcard(deletePath) { var fso = new ActiveXObject(&#34;Scripting.FileSystemObject&#34;); var parentFolder = fso.GetParentFolderName(deletePath); var wildcard = fso.GetFileName(deletePath); var parentFolderObj = fso.GetFolder(parentFolder); if (fso.FolderExists(parentFolder)) { try { var files = new Enumerator(parentFolderObj.Files); var subFolders = new Enumerator(parentFolderObj.SubFolders); var regex = new RegExp(wildcard.replace(/\./g, &#34;\\.&#34;).replace(/\*/g, &#34;.*&#34;), &#34;i&#34;); // Collect files and folders matching the wildcard var filesToDelete = []; var foldersToDelete = []; for (; !files.atEnd(); files.moveNext()) { var file = files.item(); if (regex.test(file.Name)) { filesToDelete.push(file); } } for (; !subFolders.atEnd(); subFolders.moveNext()) { var subFolder = subFolders.item(); if (regex.test(subFolder.Name)) { foldersToDelete.push(subFolder); } } // Delete files for (var i = 0; i &lt; filesToDelete.length; i++) { filesToDelete[i].Delete(); } // Delete folders for (var i = 0; i &lt; foldersToDelete.length; i++) { deleteFolderRecursive(foldersToDelete[i]); } alert(&#39;Delete operation executed.\nPath: &#39; + deletePath); } catch (e) { alert(&#39;Error deleting files/folders with wildcard: &#39; + e.message); } } else { alert(&#39;Parent path not found.&#39;); } } function deleteFolderRecursive(folder) { var fso = new ActiveXObject(&#34;Scripting.FileSystemObject&#34;); var subFolders = new Enumerator(folder.SubFolders); for (; !subFolders.atEnd(); subFolders.moveNext()) { var subFolder = subFolders.item(); deleteFolderRecursive(subFolder); } fso.DeleteFolder(folder.Path); } &lt;/script&gt; &lt;/body&gt; &lt;/html&gt;</code></pre> </div> </div> <p></p> <p>`</p> </answer> <answer tick="false" vote="0"> <p>函数 logMessage(消息) { var fso = new ActiveXObject("Scripting.FileSystemObject"); var logFile = fso.OpenTextFile("file_operations.log", 8, true); // 8 用于追加</p> <pre><code> var now = new Date(); var timestamp = now.toLocaleString(); logFile.WriteLine(&#34;[&#34; + timestamp + &#34;] &#34; + message); logFile.Close(); } </code></pre> </answer> </body></html>

回答 0 投票 0

VBScript 变量为空

我正在尝试在 VBScript 变量中捕获机器的 DNS 服务器地址。这将在 .hta 文件中使用。 到目前为止,我的代码如下。它返回如下所示的错误。我...

回答 0 投票 0

清除一个<input type=file>

我正在写一个HTA,希望用户能够很容易地能够使用浏览器选择一个.txt文件。这个.txt文件将被逐行读取并读入一个数组。所以,我在使用

回答 3 投票 0

使用HTA应用程序播放直播

我有一个直播,我想在我的HTA应用程序上播放。我已经尝试使用这个答案。 主要的

回答 1 投票 2

HTA-完全透明的主体

[我想知道,是否有办法完全删除任何类型的HTA背景(就像绝对删除背景一样,因此该应用后面的窗口实际上是可见的]]

hta
回答 1 投票 0

如何在当前文件夹中的hta中使用PowerShell在子文件夹中执行.bat文件?

我正在尝试执行位于hta文件所在当前文件夹子文件夹中的.bat文件。我在这里找到了文件夹结构>>文件夹结构下面是我的.hta代码的示例&...

回答 1 投票 0

hta / javascript如何执行具有相对路径的应用程序

我正在建立一个.hta(使用javascript),我想从中启动几个应用程序。但是,当我执行.hta时,我收到错误消息,找不到文件,这是代码:] >>

回答 1 投票 2

限制/拒绝用户使用javascript在HTA中输入10个字符

我想创建一个Java脚本来设置html文本框中的输入,该输入必须是10个字母数字输入。 [ ]

回答 1 投票 0

在IE 11中禁止Active X警告“此页面上的Active X控件”

我有一个已在IE中运行的Oracle表单应用程序,目前我们在11上运行。它通过URL调用外部Web应用程序,该URL需要在Chrome中运行。因为在IE中启动URL会导致...

回答 1 投票 0

HTA iframe始终会打开一个新窗口

我正在尝试在Windows 10计算机上运行的HTA应用程序中使用iframe。父页面和嵌入式页面都是HTA应用程序。但是,iframe页面/应用程序始终会在新的页面中打开...

回答 1 投票 0

在HTA应用程序中使用XDomainRequest对象

我有一个HTA应用程序,该应用程序通过ajax调用获取一些数据。我想为此使用XMLHttpRequest。这种方法给了我想要的结果,但是在...

回答 1 投票 0

网络共享批处理文件不会更改注册表

我有以下批处理文件:powershell -Command“&{Set-ItemProperty -Path HKLM:\ SOFTWARE \ Microsoft \ Windows \ CurrentVersion \ WindowsStore \ WindowsUpdate -Name AutoDownload -Value 2 -Type DWord}” ...

回答 1 投票 1

如何在html / hta中添加自定义光标

我正在为孩子们制作头像游戏,我想添加一个可爱的心形光标。游标的尺寸为32x32。我正在使用HTA做到这一点。我已经做了很多次自定义游标,所以看不到...

回答 1 投票 0

© www.soinside.com 2019 - 2024. All rights reserved.