How to Fix Backup and Sync “failed to execute script main”
Today’s post is about how to fix the Google Drive Backup and sync error of “failed to execute script main”.
So, here’s the background. Yesterday morning, I woke up my computer from sleep mode. Google Drive should be running all the time to back up my files, but yesterday, the Backup and sync icon was disappeared from my taskbar.
I tried to open the program again, but got the following error:
(A screenshot from Google Drive Help Community)
After clicked on “OK”, the “failed to execute script main” window popped up.
(A screenshot from Google Drive Help Community)
By following the suggestions that I found online, I tried:
- Restarted the PC (didn’t work for me).
- Downloaded the latest version of Google Backup and sync, uninstalled the former version, then installed the latest one (didn’t work for me).
- Cleaned up any leftover install/Google Drive folders/subfolders/temp files, restarted the computer, reinstalled the program, and then ran Google Drive as administrator (didn’t work for me).
- …
Fortunately, I opened Windows Security to have a look. Found Google.exe was been blocked. After allowed it manually, the problem was solved.
I totally relate to how software issues like this can drive you crazy, so I’ve put up some solutions that might be helpful to fix the “Backup and sync failed to execute script main” error.
Solution for Fixing Google Drive “failed to execute script main” on Windows 10, 8, 7, etc.: Check the Protection History of Your Antivirus Software
Windows Security shows a green tick and doesn’t prompt any message does not mean that it hasn’t blocked something. Some other antivirus protections might be the same, so this is the first solution you should check.
**Check both Windows Security and your antivirus software, in case you have one.
Steps:
- Open “Windows Security” > “Virus & threat protection” > “Protection history”.
- Look at the “App or process blocked” item, if you find something like googledrivesync.exe, GOOGLE.EXE, etc. you need to click on “Actions” > “Allow on device”.
- Reopen Google Backup and sync.
Follow These Steps If It Still Doesn’t Work
- Make sure you are using a Windows login account that has full administrator privileges.
- Uninstall Backup and sync in Control Panel\Programs\Programs and Features
- Restart your computer.
- Clean up any leftover files of Backup and sync:
- Delete the folder and all subfolders found here: C:\Program Files\Google\Drive (Depending on where the installation failed, this may not be present)
- Delete the folder and all subfolders found here: C:\Users\YOUR-WINDOWS-USERNAME\AppData\Local\Google\Drive (Depending on where the installation failed, this may not be present)
- Clean up as much of your Windows Temp folder as possible: C:\Windows\Temp (Some files are unable to be deleted. You can just skip those).
- Clean out any partial registry keys:
- Press Windows Key + R
- type regedit then click OK to run
- Accept the request by the operating system to permit the command.
- Navigate to the key location: Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Google\Drive (Depending on where the installation failed, this may not be present).
- If present, on the left side, right click the Drive entry and select delete.
- Download and install the latest version of Backup and sync from Google.
To our reader who’s reading this post: if you have tried other solutions that work for you, welcome to drop a comment below. It definitely can save someone’s day! 😊