欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

BCompare4,30天

程序员文章站 2022-05-29 20:04:08
...
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

/**
 * @author wangcx
 * @since 2018-04-11
 */
public class BCompare {

   
    public static void main(String[] args) throws InterruptedException {
        Runtime runtime = Runtime.getRuntime();
        String cmdfindid = "whoami /user";
        try {
            BufferedReader input = new BufferedReader(new InputStreamReader(runtime.exec(cmdfindid).getInputStream()));
            String line = null;
            String b = "";
            while ((line = input.readLine()) != null) {
                b = line;
            }
            String[] SID = b.split(" ");
            String break_cmd = "reg delete \"HKEY_USERS\\" + SID[1]
                    + "\\Software\\Scooter Software\\Beyond Compare 4\" /v CacheId /f";
            System.out.println(break_cmd);
            runtime.exec(break_cmd);
        }
        catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }

    }

}

 

相关标签: BCompare4