没有 Python 的 Windows 的最佳方法
复制以下代码并将文件另存为.ps1扩展名
保存文件后,右键单击它并选择“使用 PowerShell 运行”
Clear-Host
Echo "toggling scroll lock"
$WShell = New-Object -com "Wscript.Shell"
while ($true) {
$WShell.sendkeys("{SCROLLLOCK}")
Start-Sleep -Milliseconds 200
$WShell.sendkeys("{SCROLLLOCK}")
Start-Sleep -Seconds 350
}
Run Code Online (Sandbox Code Playgroud)