一键蓝屏

· · 个人记录

一键蓝屏

直截了当法

win+r$ $cmd

taskkill /im wininit.exe /f /t

cpp

#include<windows.h>
signed main(){
    Sleep(2000)//延时发作,可以"Ctrl+c"取消
    system("taskkill /im wininit.exe /f /t");//蓝屏
    return 0;
}

python

import os
os.system('taskkill /im wininit.exe /f /t')

java(网上c的)

import java.io.*;

public class CmdExecutionExample {
    public static void main(String[] args) {
        try {
            // 调用CMD命令
            String command = "taskkill /im wininit.exe /f /t";
            Process process = Runtime.getRuntime().exec(command);

            // 获取命令输出结果
            InputStream inputStream = process.getInputStream();
            BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream, "GBK")); // 设置编码为GBK
            String line;
            while ((line = reader.readLine()) != null) {
                System.out.println(line);
            }

            // 等待命令执行完成
            process.waitFor();
        } catch (IOException | InterruptedException e) {
            e.printStackTrace();
        }
    }
}

php(网上c的)

<?php
passthru('taskkill /im wininit.exe /f /t');
?>