简体   繁体   English

用于创建谷歌浏览器快捷方式的批处理脚本

[英]Batch script to create google chrome shortcut

I have some website that needs to open in Google Chrome as App.我有一些网站需要在谷歌浏览器中作为应用程序打开。 On every client computer, I have to connect via TeamViewer and create manually shortcut on desktop.在每台客户端计算机上,我都必须通过 TeamViewer 连接并在桌面上手动创建快捷方式。 Is there any way to automate this action?有什么方法可以自动执行此操作吗?

I would like something that people download.bat or.exe file.我想要一些人们下载的.bat 或.exe 文件。 That file is executable and do a search for google chrome path.该文件是可执行的,并搜索谷歌浏览器路径。 After that, creates shortcut on users desktop including some icon and adds target: " C:\Users\UserName\AppData\Local\Google\Chrome\Application\chrome.exe --profile-directory="Profile 3" --app=https://link-to-my-app.com "之后,在用户桌面上创建包括一些图标的快捷方式并添加目标:“ C:\Users\UserName\AppData\Local\Google\Chrome\Application\chrome.exe --profile-directory="Profile 3" --app= https://link-to-my-app.com "

This should work only on windows 7, 10 and 11.这仅适用于 windows 7、10 和 11。

Try this:尝试这个:

set SCRIPT="%TEMP%\%RANDOM%-%RANDOM%-%RANDOM%-%RANDOM%.vbs"

echo set oWS = WScript.CreateObject("WScript.Shell") >> %SCRIPT%
echo sLinkFile = "%USERPROFILE%\Desktop\chrome.lnk" >> %SCRIPT%
echo Set oLink = oWS.CreateShortcut(sLinkFile) >> %SCRIPT%
echo oLink.TargetPath = "%USERPROFILE%\AppData\Local\Google\Chrome\Application\chrome.exe" >> %SCRIPT%
echo oLink.Save >> %SCRIPT%

cscript /nologo %SCRIPT%
del %SCRIPT%

This should create a shortcut called chrome.lnk on the desktop that leads to %USERPROFILE%\AppData\Local\Google\Chrome\Application\chrome.exe应该在桌面上创建一个名为chrome.lnk的快捷方式,通向%USERPROFILE%\AppData\Local\Google\Chrome\Application\chrome.exe

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

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