When you log in to the computer, if you see a message box with an error message saying Can not find script file in Windows 10, then this post may be able to guide you in the right direction to resolve the issue. Windows users usually see it when they log-in.
How to fix Cannot find script file in Windows 10
Windows uses script files to run a lot of programs in Windows. Many of them are set to run as soon as you log in to the computer, while others could be based on a trigger. That said, usually, scripts set by Windows do not fail, and chances are some malware had set up a script to run. However, since it has been removed from the computer, the file is missing, and Windows Startup gives an error. This error can also occur after an incomplete uninstallation. While the file may have been removed, the script or the scheduled trigger remains. Here are the steps you can carry out to resolve the issue-
- Check the ownership of this script
- Reinstall the program
- Fix Winlogin entry via Registry
- Fix the .vbs entry in Registry
- Run an Antivirus scan.
1] Does this script file belong to you?
The error message can appear as – Cannot find script file or Cannot Run.vbs. That said, there is one thing which I want you to be sure of before we go ahead and fix it.
Does the error message box display the path of the script file or any file? If yes, you need to figure out if this was set up or installed by you. If you have set up some macro to run during the startup or have a program that has done it when you set it up, then it would be better if you fix it using the original method.
Usually, these script files are available in the Startup folder or they run using the Task Scheduler. I would strongly suggest going through them if you are unable to find your custom script.
You should also check if the file was related to a program that you recently uninstalled.
Read: Cannot find script file HPAudioswitchLC.vbs at startup.
2] Reinstall the program
If you can identify the program with which the missing file is associated with. I suggest you reinstall the program and see.
If it is a Windows OS file, run System File Checker.
Read: The system cannot find the file specified.
2] Using Registry Editor to fix Winlogon entry
Open Registry Editor by typing regedit in the Run prompt followed by pressing the enter key.
Navigate to the following path in the editor
Locate the string Userinit, and double click to edit it
The default value of the string is “C:\Windows\system32\userinit.exe,” if there is anything else than it, then make sure to change it, and click on the OK button.
Log out and log-in again to check if the error is now gone.
3] Run.vbs error
If you receive a Windows Script Host error, then you need to set the default value for the vbs key.
You will have to use the Registry Editor to change the value at-
Follow our detailed guide to fix Windows Script Host error.
You may also want to check if the Windows Script Host access is disabled on your machine.
Read: Cannot find script file run.vbs at logon
4] Recreate the missing files
If you are not able to find which program is calling that file, and you have tried everything, I would suggest recreating the file, and see what happens.
- Note the path, and navigate to it using File Explorer
- If other folder structures are missing as well, you will have to create it
- Once you create the blank file wait for it to be called by the program
- If nothing happens, you are all set.
If the application is a legit one, I am sure you will see the related error again, giving you information about what has gone wrong. Sometimes we end up using a junk cleaner, and the software removes files thinking its a junk file.
4] Run Antivirus
While not necessary, if the script file doesn’t belong to you, then it to make sure the system is not compromised further; it is best to run the antivirus software once. You can use any antivirus solution or the in-built Windows Security software to scan and remove the problem.
We hope something here helps you.