全屏打开某网页且禁用右键禁用缩放的bat

@echo off
set URL=""

start "" "c:\Program Files\Google\Chrome\Application\chrome.exe" --disable-pinch --kiosk %URL%

echo document.oncontextmenu = function() {return false;}; > %temp%\disable_right_click.js
echo document.onkeydown = function(e) {if (e.keyCode == 123) {return false;}}; >> %temp%\disable_right_click.js

timeout /t 5

REM 通过命令行执行JavaScript来禁用右键菜单和快捷键
powershell -Command "Add-Type -AssemblyName PresentationCore; [System.Windows.Forms.SendKeys]::SendWait('^{L}')"
powershell -Command "Start-Sleep -Seconds 2"
powershell -Command "$wshell = New-Object -ComObject wscript.shell; $wshell.AppActivate('chrome'); Start-Sleep -Milliseconds 500; $wshell.SendKeys('^(L)javascript: ' + (Get-Content %temp%\disable_right_click.js -Raw) + '{ENTER}'); Start-Sleep -Milliseconds 500;"


评论

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注