「java关闭电脑」如何关闭Java

博主:adminadmin 2023-01-01 07:54:09 923

本篇文章给大家谈谈java关闭电脑,以及如何关闭Java对应的知识点,希望对各位有所帮助,不要忘了收藏本站喔。

本文目录一览:

java怎么实现远程关闭计算机,远程唤醒的做好了,远程关机的不知道该怎么做

有管理员权限吧,那用shutdown命令就可以了

shutdown -m \\192.168.0.10 -f -s -t 0

shutdown /? 看看帮助信息。

C:\Windows\system32shutdown /?

Usage: shutdown [/i | /l | /s | /r | /g | /a | /p | /h | /e] [/f]

[/m \\computer][/t xxx][/d [p|u:]xx:yy [/c "comment"]]

No args Display help. This is the same as typing /?.

/? Display help. This is the same as not typing any options.

/i Display the graphical user interface (GUI).

This must be the first option.

/l Log off. This cannot be used with /m or /d options.

/s Shutdown the computer.

/r Shutdown and restart the computer.

/g Shutdown and restart the computer. After the system is

rebooted, restart any registered applications.

/a Abort a system shutdown.

This can only be used during the time-out period.

/p Turn off the local computer with no time-out or warning.

Can be used with /d and /f options.

/h Hibernate the local computer.

Can be used with the /f option.

/e Document the reason for an unexpected shutdown of a computer.

/m \\computer Specify the target computer.

/t xxx Set the time-out period before shutdown to xxx seconds.

The valid range is 0-315360000 (10 years), with a default of 30.

If the timeout period is greater than 0, the /f parameter is

implied.

/c "comment" Comment on the reason for the restart or shutdown.

Maximum of 512 characters allowed.

/f Force running applications to close without forewarning users.

The /f parameter is implied when a value greater than 0 is

specified for the /t parameter.

/d [p|u:]xx:yy Provide the reason for the restart or shutdown.

p indicates that the restart or shutdown is planned.

u indicates that the reason is user defined.

If neither p nor u is specified the restart or shutdown is

unplanned.

xx is the major reason number (positive integer less than 256).

yy is the minor reason number (positive integer less than 65536).

电脑JAVA更新程序怎么永久关闭

电脑JAVA更新程序永久关闭的方法如下

首先打开计算机的控制面板,“开始”-“控制面板”,如下图所示:

进入控制面板之后,选择“Java”并进入,如下图所示:

进入“Java控制面板”之后,点击更新,然后取消勾选“自动检查更新”,在接下来弹出的对话框中选择“不检查”。如下图所示:

然后再点击“高级”,并在应用程序一栏中选择“从不安装”,如下图所示:

经过以上操作之后,Java更新程序即可永久关闭了。

请教一个JAVA问题。能不能用JAVA编写一个程序,去关闭电脑上的一个程序呢?希望给一个完整的程序。

/**

* 根据映像名称关闭进程

* @param programName

*/

public static void killTask(String programName) {

String[] args = new String[]{"Taskkill", "/f", "/IM", programName};

try {

Runtime.getRuntime().exec(args);

} catch (IOException e) {

}

}

不过这个方法必须要有一个关闭进程的bat文件,programName就是该文件的路径+文件名

怎样用JAVA编写一个程序去关闭电脑上的一个软件呢?请帮我写一个完整的程序。

我只提供思路,具体实现你自己去弄,很简单:

1.在命令行里面输入tskill PPAP,就可以结束PPAP进程

2.java中的Runtime类提供一个直接运行命令行程序的方法:

Process p=null;

p=Runtime.getRuntime().exec("tskill PPAP");

Thread.sleep(2000);

p.destroy();

会抛出异常的,要用try catch包含

具体结束哪个程序你可以通过键盘输入,传进去执行。自己玩吧。

在windows xp系统的非管理员用户下如何用java程序定时自动关闭计算机机?

把管理员的权限改一下不就行了么,要不就在运行里输入shutdown

-s

-t

60

可以的啊!

java关闭电脑的介绍就聊到这里吧,感谢你花时间阅读本站内容,更多关于如何关闭Java、java关闭电脑的信息别忘了在本站进行查找喔。