如何隐藏 Windows 脚本宿主 window?
How to hide Windows Script Host window?
我今天开始使用一个名为 "oblytile" 的程序,它使您能够在 Windows 8/8.1 中向 Metro UI 添加自定义图块。该程序运行良好,但是当我将创建的图块打开到文件夹、程序、文件等时,我遇到了一个大问题。短时间内弹出一个黑色的小 window(如 CMD),如下所示:
并且在 window 消失后,我想要的程序打开。我看过一些 YouTube 视频,其他人没有这样的视频。我检查了一个程序存储有关图块数据的文件夹,我发现每次单击 Metro 中的自定义图块 UI 都会启动 VBScript。
示例磁贴 VBScript:
On Error Resume Next
Set objShell = CreateObject("Wscript.Shell")
Set objFSO = CreateObject("Scripting.FileSystemObject")
strApp = "C:\Users\bluea_000\OneDrive"
arrPath = Split(strApp, "\")
For i = 0 to Ubound(arrPath) - 1
strAppPath = strAppPath & arrPath(i) & "\"
Next
objShell.CurrentDirectory = strAppPath
objShell.Run """C:\Users\bluea_000\OneDrive""" & ""
If Err.Number <> 0 Then
If InStr(1, strApp, "/") > 0 then
Else
If InStr(1, strApp, "www.") > 0 then
Else
If InStr(1, strApp, "shell:") > 0 then
Else
If objFSO.folderExists(strApp) Then
Else
If objFSO.FileExists(strApp) Then
Else
MsgBox strApp & " not found", 16, "OblyTile"
End If
End If
End If
End If
End If
Err.Clear
End If
谁能告诉我如何隐藏这个黑色 window 或修复它?
我在论坛上问了这个程序是在哪里发布的,但可能这个项目已经被放弃了,没有人会回答我。
vbs 文件有两种解释器。 Wscript 和 cscript。
Cscript 是基于命令行的脚本宿主,因此会打开黑色控制台 window,wscript 是基于 windows 的脚本宿主,不会打开命令行 window.
使用 wscript 执行脚本,不会弹出黑色 window。
我今天开始使用一个名为 "oblytile" 的程序,它使您能够在 Windows 8/8.1 中向 Metro UI 添加自定义图块。该程序运行良好,但是当我将创建的图块打开到文件夹、程序、文件等时,我遇到了一个大问题。短时间内弹出一个黑色的小 window(如 CMD),如下所示:
并且在 window 消失后,我想要的程序打开。我看过一些 YouTube 视频,其他人没有这样的视频。我检查了一个程序存储有关图块数据的文件夹,我发现每次单击 Metro 中的自定义图块 UI 都会启动 VBScript。
示例磁贴 VBScript:
On Error Resume Next
Set objShell = CreateObject("Wscript.Shell")
Set objFSO = CreateObject("Scripting.FileSystemObject")
strApp = "C:\Users\bluea_000\OneDrive"
arrPath = Split(strApp, "\")
For i = 0 to Ubound(arrPath) - 1
strAppPath = strAppPath & arrPath(i) & "\"
Next
objShell.CurrentDirectory = strAppPath
objShell.Run """C:\Users\bluea_000\OneDrive""" & ""
If Err.Number <> 0 Then
If InStr(1, strApp, "/") > 0 then
Else
If InStr(1, strApp, "www.") > 0 then
Else
If InStr(1, strApp, "shell:") > 0 then
Else
If objFSO.folderExists(strApp) Then
Else
If objFSO.FileExists(strApp) Then
Else
MsgBox strApp & " not found", 16, "OblyTile"
End If
End If
End If
End If
End If
Err.Clear
End If
谁能告诉我如何隐藏这个黑色 window 或修复它?
我在论坛上问了这个程序是在哪里发布的,但可能这个项目已经被放弃了,没有人会回答我。
vbs 文件有两种解释器。 Wscript 和 cscript。
Cscript 是基于命令行的脚本宿主,因此会打开黑色控制台 window,wscript 是基于 windows 的脚本宿主,不会打开命令行 window.
使用 wscript 执行脚本,不会弹出黑色 window。