Windows trying to run maintenance.vbs on startup

Open

Every time I boot Windows, I get an empty command-line window (at c:\Windows\system32) and an error in a "Windows Script Host" pop-up. It says "Cannot find script file "C:\Windows\system32\Maintenance.vbs". The command line used to close automatically but I edited my registry to stop that so I could investigate what was happening. Now I have to manually run explorer from the command-line to finish starting windows.

I looked for maintenance.vbs in file explorer, the registry, and startup items. Nothing. I want to find what is attempting to run this script and stop it. Please help. Thanks

Posted Oct 4, 2019, 5:25 PM UTC

18
FlavorJ•

Probably in the registry, but it could be something else trying to load it. Run a malware scan first to be sure you're clean, and if it's infection-related then it'll probably take care of it: https://www.reddit.com/r/techsupport/comments/33evdi/suggested_reading_official_malware_removal_guide/

If not, when you search the registry, make sure you don't check "Match whole string only". Only search for "Maintenance.vbs". It will probably take a very long time to search. You can narrow it down to the Software/Microsoft/Windows [NT] keys to start instead of searching the whole thing.

Also check Task Scheduler. There could be something in there.

Also found this: https://answers.microsoft.com/en-us/windows/forum/windows_10-performance/maintenancevbs-windows-script-host-error/9f380a60-333b-4276-bc96-53137dd82ae1

1
knowledge3754OP•

Thanks! I was all but ready to give up after following your instructions and getting to the searching of task scheduler. The Microsoft\Windows folder has a ton of subfolders! But one was named Maintenance, and, in there, there's an InstallWinSAT task that runs maintenance.vbs when anyone logs in. Disabling this made my computer boot perfectly again.

I see that WinSAT is a legit Windows tool so I won't touch the other, legit-looking task that's in this folder. Is it safe to delete the InstallWinSAT task?

1
FlavorJ•

You could probably just delete the value, at least the part that has maintenance.vbs In task Scheduler, you can delete a task but it might get added back by MS.

1
knowledge3754OP•

True. Ok I'll do that

1
[deleted]•

Hey sorry to revive this, but yours is basically the only post close to my situation. Whenever I boot I go straight to the command window and line you mention - I never set for this to happen. After I run explorer through command I get that exact same error as you.

Real weird, I don't even know why I boot straight to the command window.

1
knowledge3754OP•

I think it's trying to run the command on boot up. My guess is that it's some leftover from a Trojan infection.

Check the comment from u/FlavorJ, it gives instructions for ensuring that the infection is cleared, and then for finding what is running this command. For me, a task scheduler item ended up being the culprit. Let me know if this helps

1
[deleted]•

Hey thanks for the help. It's my backup laptop, and it seems to have no other functional issues so I'll probably take some time to get around to it but my guess is you're right.

I never thought it would be a trojan as it started happening around the time I was jettisoning.... some non essential, 'windows bloatware' I guess from windows/systemapps and similar folders, from my limited SSD. Some of them have weird interdependencies and let me ust say removing the bulk of onedrive really fucked up a lot of random areas of windows, even though I had already disabled onedrive.

Real stupid shit. And you'd be surprised how much space poorly optimised windows features take up.

Anyway thanks again for the help.

1
knowledge3754OP•

You're welcome. I guess it could be a legit task that was orphaned when you removed all of that stuff.

1