谷歌浏览器总是说:“谷歌浏览器没有正确关闭" [英] Google Chrome always says, “Google Chrome was not shut down properly”

查看:666
本文介绍了谷歌浏览器总是说:“谷歌浏览器没有正确关闭"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在VBS文件脚本中使用此代码来自动关闭Chrome浏览器

I using in the VBS file script this code for closing Chrome browser automatically

   Set objExec = browobj.Exec("tasklist /fi " & Chr(34) & "imagename eq chrome.exe" & Chr(34))
   If Not InStr(1, objExec.StdOut.ReadAll(), "INFO: No tasks", vbTextCompare) Then
       browobj.Run "taskkill /f /t /im chrome.exe", 0, True
   End If 

问题在于,当我始终使用以下方式重新打开浏览器时

the problem is that when i reopen the browser always with

   Set browobj = CreateObject("Wscript.Shell")
   siteA = "http://XXXXXXX/"
   browobj.Run "chrome -url " & siteA

我有错

Chrome浏览器未正确关闭

Google Chrome was not shut down properly

怎么了?

为什么会这样?

推荐答案

请参阅@ tuxy42的答案:

Refer to the answer of @tuxy42 : here

您可以像这样打开Chrome浏览器: Open_Chrome_Browser.vbs

You can write to open chrome browser like this : Open_Chrome_Browser.vbs

Set ws = CreateObject("Wscript.Shell")
siteA = "https://stackoverflow.com/questions/62516355/google-chrome-always-says-google-chrome-was-not-shut-down-properly"
ws.Run "chrome -url " & siteA

如果要安全关闭它: safely_close_chrome_browser.vbs

And if you want to close it safely : safely_close_chrome_browser.vbs

Set ws = CreateObject("Wscript.Shell")
psCommand = "Cmd /C powershell -command ""Get-Process chrome | ForEach-Object { $_.CloseMainWindow() | Out-Null}"""
ws.run psCommand,0,True

这篇关于谷歌浏览器总是说:“谷歌浏览器没有正确关闭"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆