简体   繁体   English

Windows - 如何在 Windows 服务中创建可以检查谷歌浏览器是否正在运行,如果没有然后执行它

[英]Windows - how to make in windows service which can check google chrome is running or not if not then execute it

I have a kiosk in Railway where i am using this batch file, but the problem is at 8AM there are too many school kids in front of the machine, when they see a Command prompt, they press the X icon and close my application, i get then report that my software is not working, but it was actually switched off by someone while starting.我在铁路有一个信息亭,我正在使用这个批处理文件,但问题是在早上 8 点,机器前面有太多学童,当他们看到命令提示时,他们按下 X 图标并关闭我的应用程序,我得到然后报告我的软件不工作,但它实际上在启动时被某人关闭了。

How can i make this script execute when-ever chrome.exe is not running please?我怎样才能让这个脚本在 chrome.exe 没有运行时执行? (for example if someone kills it using mouse or touch screen) (例如,如果有人使用鼠标或触摸屏杀死它)

timeout 5 > nul
::@start /b cmd /c "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --kiosk 
@start /b cmd /c "C:\Users\tpt\Downloads\old-chrome\chrome64_49.0.2623.75\chrome.exe" --kiosk

I have set up kiosks before and replaced the Windows Explorer shell with a custom application.我之前设置了信息亭,并用自定义应用程序替换了 Windows 资源管理器外壳。

Change the Shell value in the following registry key:更改以下注册表项中的 Shell 值:

HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon

You may be able to just run chrome like this without having to call it via a cmd shell.您可以像这样运行 chrome 而不必通过 cmd shell 调用它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM