Windows XP Windows 7 Windows 2003 Windows Vista Windows 綜合教學 Linux 系統教學
Windows 10 Windows 8 Windows 2008 Windows NT Windows Server 電腦軟體教學

Windows 10 隱藏程式視窗背景執行:VBScript WShell.Run 參數 0 實作教學

編輯:Windows 10 系統介紹

需讓程式完全背景執行 (無工作列圖示、無 Alt+Tab 切換、僅工作管理員可見進程)?Windows 原生 VBScript WScript.Shell.Run 方法參數 0 即可實現,無需第三方工具。

方法:VBScript 隱藏啟動

  1. 開啟記事本,貼入以下碼 (以內建「寫字板」為例):
Dim WShell
Set WShell = CreateObject("WScript.Shell")
WShell.Run "wordpad.exe", 0  ' 參數 0 = 隱藏視窗
Set WShell = Nothing
  1. 存檔為 hidden_notepad.vbs (副檔名 .vbs)。
  2. 雙擊執行,寫字板將隱形運行 (工作管理器可見 wordpad.exe 進程)。

VBScript 程式碼範例

儲存為 .vbs 檔案

工作管理器見進程

第三方程式路徑含空白字元處理

Dim WShell
Set WShell = CreateObject("WScript.Shell")
' 路徑含空白需雙層引號:"""路徑"""
WShell.Run """D:\Program Files (x86)\Ruanmei\PCMaster\cleanmaster.exe""", 0
Set WShell = Nothing

第三方程式隱藏啟動碼

UAC 提權提示無法隱藏

點擊是後隱形運行

限制:
  • 需 UAC 提權的程式,權限提示視窗無法隱藏 (點「是」後進程隱形)。
  • 僅隱藏視窗,進程仍在工作管理器可見,非真正的 Rootkit 隱藏。
  • 批次檔 (.bat) 同理可用 start /b 或呼叫 .vbs 包裝。
Copyright © Windows教程網 All Rights Reserved