Comment maintenir le système actif en cas d'inactivité sous Windows et Linux ?
Comment maintenir le système actif en cas d'inactivité sous Windows et Linux ?
Comment maintenir le système actif en cas d'inactivité sous Windows et Linux ?
Re: Comment maintenir le système actif en cas d'inactivité sous Windows et Linux ?
**Meilleure méthode pour Windows sans Python**
Copiez le code ci-dessous et enregistrez le fichier avec l'extension **.ps1**
Après avoir enregistré le fichier, faites un clic droit dessus et sélectionnez **Exécuter avec 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
}
```
Copiez le code ci-dessous et enregistrez le fichier avec l'extension **.ps1**
Après avoir enregistré le fichier, faites un clic droit dessus et sélectionnez **Exécuter avec 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
}
```