How to Fix: Chrome Slow: CPU, Mem High? Daily Reset Script
Infopackets Readers Jay S. writes:
" Dear Dennis,
Thanks for your article on
How to Fix:
Brave Browser Slow (High CPU, RAM) Script. I have a similar question, but this time it's with Chrome.
As with the other user mentioned in your article, every so often Chrome starts
to lag and become unresponsive / slow. When I check Task Manager, I often see some of the chrome.exe processes eating up 2GB+ of memory. I'm not using any extensions, so I'm not sure why
this happens, other than perhaps Chrome is caching too much information or there
is a memory leak of some kind.
Anyhow, I would like to have an automated script that will close Chrome.exe at 6am and relaunch it so that it's fast and fresh to use in the morning. I will pay you to
remote into my machine and come up with a solution.
I do have some stipulations: I am running a multi-user environment with RDP Wrapper and have multiple users on my machine and they all use their own chrome.exe executables. I tried your script from the Chrome article you wrote but it won't close Chrome,
so I think the script needs some tweaking. "
My response:
I asked Jay if he would like me to connect to his machine to look into the issue with my remote desktop service, and he agreed.
Below I will discuss my findings.
How to Fix: Chrome Slow: CPU, Mem High? Daily Reset Script
After some extended experimenting, I put together a working batch script to resolve Chrome's high CPU usage and excessive memory drain. The script is designed to safely shut down Chrome in a multi-user (or single user) environment, ensure it's fully closed, then restarts Chrome automatically daily at 6am (or whenever the user wants to run the script).
The script can be run using Task Manager on demand (at 6am daily, for example). This helps keep Chrome running fast and lag-free without performance hiccups and without losing your open tabs. The script keeps a log file to tell you when it ran and then truncates the log. It will only run under the current user so it is safe to run in a multi-user (or single user) environment.
How The Chrome Daily Reset Script Works
When the script runs, it sends a graceful exit request to Chrome. The script then monitors Chrome's processes to ensure they've fully cleared from memory. Once Chrome is confirmed closed, the script pauses for a few seconds and then starts it up again - ready to pick up where you left off without the bloat.
Before You Use the Script
- Enable Tab Session Restore in Chrome:
You need to make sure Chrome resumes where it left off after a restart.
- Launch chrome and paste in the following into Chrome's URL path
chrome://settings/onStartup
- Select "Continue where you left off"
- Launch chrome and paste in the following into Chrome's URL path
- Make Chrome the Default Browser: In order for the script to be
able to open web links in third party programs (like email), it needs to be
set as default browser.
- Launch chrome and paste in the following into Chrome's URL path:
chrome://settings/defaultBrowser
- Click "Make Chrome your default browser"
- Launch chrome and paste in the following into Chrome's URL path:
Here is the Script
- Highlight the text block below with your mouse. Right-click the highlighted area and choose
Copy to place the script in your clipboard.
@echo off
setlocal enabledelayedexpansion
rem "C:\Program Files (x86)\Google\Chrome\Application\chrome_restart.bat"
rem "C:\Program Files\Google\Chrome\Application\chrome_restart.bat"
rem chrome://settings/onStartup -> continue where you left off
rem chrome://settings/defaultBrowser -> set chrome as default
REM --- Detect Chrome Path ---
if exist "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" (
set "CHROME_PATH=C:\Program Files (x86)\Google\Chrome\Application\chrome.exe"
) else if exist "C:\Program Files\Google\Chrome\Application\chrome.exe" (
set "CHROME_PATH=C:\Program Files\Google\Chrome\Application\chrome.exe"
) else (
echo Chrome not found in either location. Exiting.
exit /b
)
REM --- CONFIGURATION ---
set "USERNAME=%USERNAME%"
set "MAX_RETRIES=15"
set "LOG_FILE=%~dp0chrome_restart.log"
REM --- SETTINGS REMINDER ---
REM chrome://settings/onStartup -> Select: 'Continue where you left off"
REM chrome://flags -> Search: "Enable crash recovery bubbles" -> Set to: Disabled
echo [%DATE% %TIME%] --- Script started --- >> "%LOG_FILE%"
REM --- Get main chrome.exe PID for current user (excluding subprocesses) ---
for /f %%A in ('powershell -NoProfile -Command "Get-WmiObject Win32_Process | Where-Object { $_.Name -eq 'chrome.exe' -and $_.CommandLine -notmatch '--type=' -and $_.GetOwner().User -eq '%USERNAME%' } | Select-Object -First 1 -ExpandProperty ProcessId"') do set "MAINPID=%%A"
if "%MAINPID%"=="" (
echo [%DATE% %TIME%] No main chrome process found for user %USERNAME%. Exiting. >> "%LOG_FILE%"
goto TRIMLOG
)
echo [%DATE% %TIME%] Main chrome process is PID %MAINPID%. Closing... >> "%LOG_FILE%"
powershell -NoProfile -Command "Get-Process -Id %MAINPID% | ForEach-Object { $_.CloseMainWindow() | Out-Null }"
REM --- Wait until the main window is gone (not just the PID)
echo [%DATE% %TIME%] Waiting for chrome main window to close (gracefully only)... >> "%LOG_FILE%"
set RETRIES=0
:WAITLOOP
timeout /t 2 >nul
set /a RETRIES+=1
powershell -NoProfile -Command "$proc = Get-Process -Id %MAINPID% -ErrorAction SilentlyContinue; if ($proc -and $proc.MainWindowHandle -ne 0) { exit 1 } else { exit 0 }"
if %errorlevel%==0 (
echo [%DATE% %TIME%] chrome window has closed. Waiting 3 seconds before relaunch... >> "%LOG_FILE%"
timeout /t 3 >nul
goto LAUNCH
)
if !RETRIES! GEQ %MAX_RETRIES% (
echo [%DATE% %TIME%] chrome window did not close after %MAX_RETRIES% attempts. Skipping restart. >> "%LOG_FILE%"
goto TRIMLOG
)
goto WAITLOOP
:LAUNCH
echo [%DATE% %TIME%] Relaunching chrome... >> "%LOG_FILE%"
rem testing / won't open http links in email: start "" "%CHROME_PATH%"
rem below fixes that but you need to register chrome as default browser via chrome://settings/defaultBrowser
start "" "explorer.exe" "https://"
REM --- OPTIONAL: Clean up orphan chrome child processes tied to previous session ---
REM --- Uncomment below if you want to force-remove orphaned subprocesses from the old main PID ---
REM timeout /t 5 >nul
REM echo Cleaning up orphan chrome child processes from PID %MAINPID%... >> "%LOG_FILE%"
REM powershell -NoProfile -Command "Get-WmiObject Win32_Process ^| Where-Object { $_.Name -eq 'chrome.exe' -and $_.ParentProcessId -eq %MAINPID% -and $_.GetOwner().User -eq '%USERNAME%' } ^| ForEach-Object { Stop-Process -Id $_.ProcessId -Force }"
:TRIMLOG
REM --- TRIM LOG FILE TO LAST 100 LINES ---
set "LOG_TEMP=%TEMP%\chrome_log_trim.tmp"
powershell -NoProfile -Command "Get-Content -Path '%LOG_FILE%' -Tail 100 | Set-Content -Path '%LOG_TEMP%'"
copy /y "%LOG_TEMP%" "%LOG_FILE%" >nul
del "%LOG_TEMP%" >nul 2>&1
:DONE
echo [%DATE% %TIME%] Done. >> "%LOG_FILE%"
endlocal
exit /b
- Paste the script into Notepad.
Click Start, type
notepad
, then right-click Notepad and select Run as Administrator.
- In Notepad, click Edit -> Paste. The script should now appear
in Notepad.
- Check to see where you have Chrome installed. It should either be:
"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" OR
"C:\Program Files\Google\Chrome\Application\chrome.exe"
- Next, save the file by clicking File -> Save As, then type the filename
with quotes exactly as shown below (depending on your install
location)
:
"C:\Program Files (x86)\Google\Chrome\Application\chrome_restart.bat" OR
"C:\Program Files\Google\Chrome\Application\chrome_restart.bat"
Running the Script Manually
- Open Chrome manually so it's running and open a few tabs with different
URLs to make sure Chrome is remembering what you had opened previously.
- Now it's time to test the script. Click Start, type
cmd.exe
, then right-click Command Prompt and select Run as Administrator.
- Highlight and copy one of the lines below (depending on your install location):
"C:\Program Files (x86)\Google\Chrome\Application\chrome_restart.bat" OR
"C:\Program Files\Google\Chrome\Application\chrome_restart.bat"
- Right-click in the Command Prompt window. If successful, the script will run and Chrome should close. After a short pause, it should reopen automatically.
Automate It with Task Scheduler
Now it's time to set the script to run every morning automatically at 6am.
- Click Start, type
task scheduler
, and open it.
- In the left pane, right-click Task Scheduler Library -> Create Task
- Under the General tab -> Name:
Restart Chrome at 6am;
Check: Run only when user is logged on, Run with highest privileges, and Hidden
- Go to the Triggers tab -> Click New: Choose Daily, set time to
6:00 AM, and check Enabled
- Under Actions tab -> Click New -> Browse; select your
.bat
file depending on where Chrome is installed:"C:\Program Files (x86)\Google\Chrome\Application\chrome_restart.bat" OR
"C:\Program Files\Google\Chrome\Application\chrome_restart.bat"
- Under Settings, check Allow task to be run on demand. Click OK to finish.
Final Step: Test It
With Chrome open, go back to Task Scheduler, right-click your "Restart Chrome at 6am" task, and choose Run. If it works, Chrome should close and reopen by itself and Chrome should keep track of which tabs you had opened previously.
Most popular articles
- Which Processor is Better: Intel or AMD? - Explained
- How to Prevent Ransomware in 2018 - 10 Steps
- 5 Best Anti Ransomware Software Free
- How to Fix: Computer / Network Infected with Ransomware (10 Steps)
- How to Fix: Your Computer is Infected, Call This Number (Scam)
- Scammed by Informatico Experts? Here's What to Do
- Scammed by Smart PC Experts? Here's What to Do
- Scammed by Right PC Experts? Here's What to Do
- Scammed by PC / Web Network Experts? Here's What to Do
- How to Fix: Windows Update Won't Update
- Explained: Do I need a VPN? Are VPNs Safe for Online Banking?
- Explained: VPN vs Proxy; What's the Difference?
- Explained: Difference Between VPN Server and VPN (Service)
- Forgot Password? How to: Reset Any Password: Windows Vista, 7, 8, 10
- How to: Use a Firewall to Block Full Screen Ads on Android
- Explained: Absolute Best way to Limit Data on Android
- Explained: Difference Between Dark Web, Deep Net, Darknet and More
- Explained: If I Reset Windows 10 will it Remove Malware?

My name is Dennis Faas and I am a senior systems administrator and IT technical analyst specializing in cyber crimes (sextortion / blackmail / tech support scams) with over 30 years experience; I also run this website! If you need technical assistance , I can help. Click here to email me now; optionally, you can review my resume here. You can also read how I can fix your computer over the Internet (also includes user reviews).
We are BBB Accredited

We are BBB accredited (A+ rating), celebrating 21 years of excellence! Click to view our rating on the BBB.
Comments
Why does Chrome go slow?
Were you able to figure out why Chrome was slowing down in the first place? I thought memory leaks had been eliminated by Windows??
What would your recommendation be for a browser other than Chrome?
TIA
Extensions
Generally speaking you should disable all extensions for a few days (a week?) and see if it helps with the bloat without shutting down Chrome. If it still gets bloated after a week, then the problem isn't the extensions, in which case a daily close / reload would help, which is what the script does.