我正在尝试制作一个像程序启动器一样工作的HTA应用程序。
但是我有一些应用程序的问题,它在我的HTA应用程序下面打开。
现在我正试着用app模式在chrome中打开一个网页。但是铬在我的hta下面开始..。
我用来在chrome app模式下打开网页的代码:
Start "" "%ProgramFiles(x86)%\Google\Chrome\Application\chrome.exe" chrome --app=https://www.google.com/
我还没能找到一个我可以去工作的解决方案。我以前没有批处理编程等经验。
编辑:我正在制作的Hta应用程序用于锁定课后俱乐部中的一些游戏通勤者。我已经这样做了,用户没有访问桌面的权限。我在应用程序中禁用了ALT+F4等,因此无法关闭。
但现在他们想玩plix.io这样的网页游戏,所以我做了下面的批处理脚本来启动游戏,并使加入团队游戏成为可能,而不需要浏览器访问,地址栏可见。
这是我的bat文件
@echo off
rem not really necessary for this part
title Splix.io Launcher
color 0f
mode con: cols=80 lines=15
rem below is necessary
cls
goto main
@echo off
:main
Echo .
Echo Splix.io Launcher
Echo ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
Echo º º
Echo º 1 Start Splix Start singpleplayer eller host en team server º
Echo º º
Echo º 2 Join Team spil Deltag i et team spil º
Echo º º
Echo º 3 EXIT Luk Splix.io Launcher º
Echo º º
Echo ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
Echo .
Choice /C 123 /M "Vil du starte singleplayer eller join et team spil:"
If Errorlevel 3 Goto 3
If Errorlevel 2 Goto team
If Errorlevel 1 Goto single
:single
Start "" "%ProgramFiles(x86)%\Google\Chrome\Application\chrome.exe" chrome --app=https://www.splix.io/
echo Starter Splix.io
exit
:team
cls
color 0f
set str=error
echo Skriv de sidste 5 tegn fra Splix team adressen på hjemmesiden
echo.
set /p str=Splix.io/#team-
set len=0
goto sl
:sl
call set this=%%str:~%len%%%
if not "%this%" == "" (set /a len+=1
goto :sl)
cls
if not "%len%" == "5" (echo Fejl, Du skal skrive de sidste 5 tegn i Splix team adressen
color 4f
pause >nul
cls
goto team)
Start "" "%ProgramFiles(x86)%\Google\Chrome\Application\chrome.exe" chrome --app=https://www.splix.io/#team-%str%
echo Starter Splix.io Team spil
exit
:3
cls
exit
我不知道问题出在批处理脚本还是HTA中用于从hta打开程序的代码:
function runApp(which) {
WshShell = new ActiveXObject("WScript.Shell");
WshShell.Run (which,1,true);
}
谁能告诉我在打开Chrome应用程序后,我是如何专注于它的?
发布于 2019-09-21 23:31:54
我不知道这个HTA文件是否能帮助你:
<html>
<head>
<HTA:APPLICATION
APPLICATIONNAME="Open link with chrome browser"
BORDER="THIN"
BORDERSTYLE="NORMAL"
ICON="Explorer.exe"
INNERBORDER="NO"
MAXIMIZEBUTTON="NO"
MINIMIZEBUTTON="NO"
SCROLL="NO"
SELECTION="NO"
SINGLEINSTANCE="YES"/>
<META HTTP-EQUIV="MSThemeCompatible" CONTENT="YES">
<title>Open link with chrome browser</title>
<SCRIPT LANGUAGE="VBScript">
'************************************************************************************
Option Explicit
Function Executer(StrCmd)
Dim ws,MyCmd,Resultat
Set ws = CreateObject("wscript.Shell")
MyCmd = "CMD /C " & StrCmd & " "
Resultat = ws.run(MyCmd,0,True)
Executer = Resultat
End Function
'************************************************************************************
Sub window_onload()
CenterWindow 400,320
End Sub
'************************************************************************************
Sub CenterWindow(x,y)
Dim iLeft,itop
window.resizeTo x,y
iLeft = window.screen.availWidth/2 - x/2
itop = window.screen.availHeight/2 - y/2
window.moveTo ileft,itop
End Sub
'************************************************************************************
</script>
</head>
<p>Links :</p>
<ol>
<li><a href="#" onClick="Call Executer('Start chrome.exe www.google.com chrome --app=https://www.google.com/')">Link Google</a></li>
<li><a href="#" onClick="Call Executer('Start chrome.exe https://stackoverflow.com chrome --app=https://stackoverflow.com/')">Link Stackoverflow with Chrome.exe</a></li>
<li><a href="#" onClick="Call Executer('Start chrome.exe www.yahoo.fr chrome --app=www.yahoo.fr/')">Link Yahoo with Chrome.exe</a></li>
<li><a href="#" onClick="Call Executer('Start chrome.exe www.autoitscript.fr chrome --app=www.autoitscript.fr/')">Link Autoitscript.fr (Français) with Chrome.exe</a></li>
<li><a href="#" onClick="Call Executer('Start chrome.exe www.autoitscript.com chrome --app=www.autoitscript.com/')">Link autoitscript.com (Anglais) with Chrome.exe</a></li>
</ol>
<BODY text=white bgcolor="DarkOrange" TOPMARGIN="1" LEFTMARGIN="1">
<center><button onclick="Call Executer('Start chrome.exe www.google.com chrome --app=https://www.google.com/')">Open Google Link </button></center>
</body>
</html>
https://stackoverflow.com/questions/58027011
复制相似问题