October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix NowOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk6 min

Is mshta.exe Causing Script-Error Popups? What It Means and How to Stop Them

mshta.exe is usually a legitimate Windows HTML Application Host. Recurring script-error popups mean another file, URL, task or program is invoking it—find that trigger instead of deleting the system executable.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

mshta.exe is normally a legitimate Windows component called the Microsoft HTML Application Host. It runs HTML Application (.hta) files and can execute JavaScript or VBScript. The recurring popup is not proof that mshta.exe itself is infected: another program, scheduled task, shortcut, registry entry, local file, or URL is repeatedly asking it to run something.

Do not delete C:WindowsSystem32mshta.exe or C:WindowsSysWOW64mshta.exe. Capture the command line and parent process first, then remove or repair the trigger, scan Windows, and verify that it does not return.

As an Amazon Associate I earn from qualifying purchases.

What mshta.exe does

HTML Applications run outside the normal browser sandbox, so an HTA can access local files and Windows scripting interfaces. That is useful for some legacy utilities and installers, but it also makes the signed Windows host attractive to attackers. Microsoft documents malware that uses malicious shortcuts, JavaScript, VBScript, remote HTA content and persistence mechanisms with mshta.exe (malicious LNK examples; script-based malware and persistence).

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

On a normal installation, the executable is under the Windows directory. A copy in %AppData%, %Temp%, Downloads, %ProgramData% or a random user-created folder is a major warning sign.

Is mshta.exe malware?

Finding What it suggests
Microsoft-signed file in System32 or SysWOW64 Probably the legitimate host; the content it runs still needs checking.
Local .hta belonging to an installed legacy application Could be legitimate; verify the publisher and installation.
URL, javascript: or vbscript: argument Suspicious until you can identify and trust the source.
File under a temporary or profile-writable folder High-risk location, especially with an unfamiliar name.
Recurring scheduled task or startup entry Persistence is likely; investigate the task or entry.
PowerShell, cmd.exe, rundll32.exe or downloader child process Strong indicator of malicious activity.

A Microsoft signature authenticates the host binary, not the script, URL or file supplied to it. Conversely, a script-error dialog can come from obsolete software, a missing local file, a dead remote URL or a stale task after antivirus removed the original payload. A single error is not conclusive.

Record evidence before changing anything

  • Copy the complete popup text, including script line and character numbers.
  • Record every .hta, .js, .vbs, .cmd or .ps1 path and any URL shown.
  • Note whether it appears at sign-in, on a timer, only while online, or after opening one application.
  • Capture the process ID, parent process and full command line while the popup is visible.
  • Save the date the behavior began, recent installations and any security-detection name.

A screenshot helps, but the command line, file path, URL and task name are more useful for diagnosis. Do not double-click a suspicious HTA or script to inspect it.

Find exactly what launched it

Verify the executable and signature

Get-Command mshta.exe | Select-Object Source

$paths = @(
  "$env:windirSystem32mshta.exe",
  "$env:windirSysWOW64mshta.exe"
)

$paths | ForEach-Object {
  if (Test-Path $_) {
    Get-Item $_ | Select-Object FullName, Length, LastWriteTime
    Get-AuthenticodeSignature $_ | Select-Object Path, Status, SignerCertificate
  }
}

Run PowerShell as the affected user. The path should be under the Windows directory and the signature should normally be Valid with Microsoft as signer. That result does not certify the payload.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Capture the command line

Get-CimInstance Win32_Process -Filter "Name='mshta.exe'" |
  Select-Object ProcessId, ParentProcessId, ExecutablePath, CommandLine

Inspect CommandLine for a local HTA, an HTTP or HTTPS URL, inline script, PowerShell, command shell, a random filename or an obfuscated argument. Paths in %Temp%, %AppData%, %ProgramData% or Downloads deserve particular scrutiny.

Rank #2
Dell Latitude 5420 14" FHD Business Laptop Computer, Intel Quad-Core i5-1145G7, 16GB DDR4 RAM, 256GB SSD, Camera, HDMI, Windows 11 Pro (Renewed)
  • 256 GB SSD of storage.
  • Multitasking is easy with 16GB of RAM
  • Equipped with a blazing fast Core i5 2.00 GHz processor.

Identify the parent process

$processes = Get-CimInstance Win32_Process
$mshta = $processes | Where-Object Name -eq 'mshta.exe'

$mshta | ForEach-Object {
  $parent = $processes | Where-Object ProcessId -eq $_.ParentProcessId
  [pscustomobject]@{
    MshtaPID      = $_.ProcessId
    ParentPID     = $_.ParentProcessId
    ParentName    = $parent.Name
    ParentCommand = $parent.CommandLine
    MshtaCommand  = $_.CommandLine
  }
}

taskeng.exe or a service host can indicate a scheduled task; explorer.exe often points to Startup, a shortcut or a user action; a browser may indicate a download or compromised page; an installer may be legitimate. powershell.exe, cmd.exe or another script host as parent or child raises the risk.

Check scheduled tasks

  1. Press Win+R, enter taskschd.msc, and open Task Scheduler Library.
  2. Review tasks triggered at logon, startup, on a timer or when idle.
  3. On each suspicious task, inspect Actions, Triggers, author, description and associated file.

Search task actions from PowerShell:

Get-ScheduledTask | ForEach-Object {
  foreach ($action in $_.Actions) {
    if ($action.Execute -match 'mshta|powershell|cmd|wscript|cscript' -or
        $action.Arguments -match 'mshta|.hta|javascript:|vbscript:|powershell|.js|.vbs') {
      [pscustomobject]@{
        TaskName  = $_.TaskName
        TaskPath  = $_.TaskPath
        Execute   = $action.Execute
        Arguments = $action.Arguments
      }
    }
  }
}

Do not delete a task solely because it mentions mshta.exe. Disable a clearly malicious or obsolete task first, record its settings, restart, and confirm the diagnosis before deleting it. Enterprise, update and accessibility tasks can look unfamiliar.

Inspect Startup and other persistence with Autoruns

Microsoft Sysinternals Autoruns inventories Startup folders, Run/RunOnce keys, scheduled tasks, services, Winlogon entries and more. The page currently lists Autoruns 14.3, published June 17, 2026; versions and labels can change.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  1. Download it only from Microsoft Sysinternals and run it as administrator.
  2. Enable Hide Signed Microsoft Entries.
  3. Search for mshta, .hta, javascript:, vbscript:, powershell and profile or temporary paths.
  4. Use Properties to view the complete command line, publisher and file location.
  5. Uncheck a clearly malicious entry first, restart and verify that the popup stops. Remove its file only after preserving evidence and confirming it is unwanted.

Autoruns also provides Autorunsc for command-line work and can inspect other profiles or offline installations. It identifies entries; it does not decide whether an unfamiliar item is safe.

Rank #3

Scan and harden Windows

  1. Open Windows Security, update security intelligence, and run a Full scan.
  2. If the popup or persistence continues, save work and run Microsoft Defender Offline. Microsoft’s cleanup guidance is at Protect your PC from unwanted software.
  3. Review Protection history for the detection name and quarantined path.
Update-MpSignature
Start-MpScan -ScanType FullScan
Start-MpWDOScan

Start-MpWDOScan restarts the computer and may require administrator rights; it is not exposed on every managed or nonstandard installation.

For potentially unwanted applications, open Windows Security → App & browser control → Reputation-based protection → Potentially unwanted app blocking and enable app and download blocking where available. Microsoft describes these controls at Protect your PC from potentially unwanted applications. PUA blocking does not detect every malicious HTA or persistence entry.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Repair a legitimate cause

If the command points to a known vendor application, repair or update that application from its official source. If it is obsolete, uninstall it and remove its no-longer-needed task only after confirming ownership. A dead URL or missing dependency can be fixed by the vendor; blocking or deleting the Windows host may break other software.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

If the source is a malicious file or URL, disconnect from the network when active compromise is suspected, quarantine rather than open the file, disable its persistence, and run both Defender scans. Change important passwords from a known-clean device if credential theft is plausible. On a work or school computer, contact the administrator instead of deleting managed tasks or security controls.

Rank #4
Windows 11 Laptop with i3 Processor 15.6" Work Laptop for College Students
  • 【Efficient Performance】 Powered by Intel Core i3 processor (2 cores, 4 threads, up to 3.4GHz) with 12GB RAM and 256GB SSD. Handles multitasking, office software, online classes, and HD video streaming smoothly. Integrated Intel UHD Graphics 620
  • Backlit Keyboard & Complete Package】Comes with a cool backlit keyboard. Comes with awebcam, dual stereo speakers (8Ω/1.0W each), DC charger, and user manual – ready for late-night studying, online classes, video conferencing, and daily productivity
  • 【Vibrant Display】 15.6-inch Full HD (1920x1080) anti-glare screen with 16:9 aspect ratio delivers crisp images and vivid colors – perfect for studying, watching lectures, or entertainment. Thin-bezel design maximizes viewing area
  • 【Fast Connectivity & Expansion】 Equipped with WiFi 6 (802.11ax) and Bluetooth 5.2 for stable, high-speed wireless. Features 3 x USB 3.0, HDMI 2.1, Type-C (supports PD3.0 fast charging), and a TF card slot expandable up to 2TB – easily connect external monitors, mice, drives, or expand storage for all your files
  • 【Long Battery Life & Portable】 Built-in 11.55V 5000mAh/57.75Wh high-capacity battery delivers approximately 7 hours of mixed-use battery life – enough for a full day of classes and assignments. Lightweight at just 1.63kg (3.6 lbs) and 19.5mm thin, plus a compact packing size – easily slips into a backpack for campus, library, or coffee shop

What not to do

  • Do not delete or replace the Microsoft mshta.exe binary.
  • Do not assume Task Manager’s process name explains the payload; obtain the full command line and parent.
  • Do not open a suspicious HTA, shortcut, JavaScript, VBScript or PowerShell file.
  • Do not delete every unknown task or registry value; disable and investigate first.
  • Do not run several real-time antivirus products together or permanently disable Defender.
  • Do not treat a clean scan as proof that a startup or scheduled-task trigger is gone.

If the popup keeps returning

  1. Capture the command line and parent again while it is visible.
  2. Search all scheduled-task actions and review Autoruns as administrator.
  3. Check every Windows user profile, recently installed application and browser extension.
  4. Run Defender Offline and recheck Protection history.
  5. Restart, repeat the CIM query, and verify that the triggering entry is disabled or removed.

Escalate to a qualified professional or your organization’s security team if scans and persistence cleanup fail, credentials may have been stolen, security tools were tampered with, several devices are affected, or the computer holds sensitive information. A reset or reinstall can be appropriate when compromise cannot be confidently removed, but it is not the first response to every script error.

Frequently Asked Questions

Will ending mshta.exe stop the popups permanently?

No. Ending the process stops only the current instance; the task, shortcut, startup entry or parent application can launch it again.

Should I block mshta.exe with a firewall or policy?

Not automatically. Blocking it can break legitimate legacy or line-of-business software. First identify the command and, in managed environments, have an administrator assess application-control policy.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Quick Recap

Bestseller No. 1
Bestseller No. 2
Dell Latitude 5420 14' FHD Business Laptop Computer, Intel Quad-Core i5-1145G7, 16GB DDR4 RAM, 256GB SSD, Camera, HDMI, Windows 11 Pro (Renewed)
Dell Latitude 5420 14" FHD Business Laptop Computer, Intel Quad-Core i5-1145G7, 16GB DDR4 RAM, 256GB SSD, Camera, HDMI, Windows 11 Pro (Renewed)
256 GB SSD of storage.; Multitasking is easy with 16GB of RAM; Equipped with a blazing fast Core i5 2.00 GHz processor.
$285.00
Bestseller No. 3
HP 14' HD Laptop, Windows 11, Intel Celeron Dual-Core Processor Up to 2.60GHz, 4GB RAM, 64GB SSD, Webcam, Dale Pink (Renewed)
HP 14" HD Laptop, Windows 11, Intel Celeron Dual-Core Processor Up to 2.60GHz, 4GB RAM, 64GB SSD, Webcam, Dale Pink (Renewed)
14" diagonal, 1366x768 resolution, HD BrightView LED, Glossy NON-TOUCH Display
$245.99

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.