如何编写一个自动关机的程序

如何编写一个自动关机的程序,第1张

shutdown -f -s -t 600 -c \你是神经病\

Windows XP的关机是由Shutdownexe程序来控制的,位于Windows\System32文件夹中。如果想让Windows

2000也实现同样的效果,可以把Shutdownexe复制到系统目录下。

比如你的电脑要在22:00关机,可以选择“开始→运行”,输入“at 22:00 Shutdown -s”,这样,到了

22点电脑就会出现“系统关机”对话框,默认有30秒钟的倒计时并提示你保存工作。如果你想以倒计时的

方式关机,可以输入“Shutdownexe -s -t 3600”,这里表示60分钟后自动关机,“3600”代表60分钟

设置好自动关机后,如果想取消的话,可以在运行中输入“shutdown -a”。另外输入“shutdown -i”,

则可以打开设置自动关机对话框,对自动关机进行设置。

Shutdownexe的参数,每个都具有特定的用途,执行每一个都会产生不同的效果,比如“-s”就表示关闭

本地计算机,“-a”表示取消关机 *** 作,下面列出了更多参数,大家可以在Shutdownexe中按需使用。

-f:强行关闭应用程序

-m \\\\计算机名:控制远程计算机

-i:显示图形用户界面,但必须是Shutdown的第一个选项

-l:注销当前用户

-r:关机并重启

-t 时间:设置关机倒计时

-c \消息内容\:输入关机对话框中的消息内容(不能超127个字符,不能有空格)

至于加分就不用骗人了,看看你,才几分东西啊

自己制作一个一键关机程序,相信大家电脑里都有winrar这个软件吧,现在就利用这个软件的关机功能,1分钟做一个只有4k的关机程序。

第一步:右击桌面空白处,选择“新建→快捷方式”,d出“创建快捷方式”窗口,点击“浏览”,在浏览文件夹窗口找到WinRAR安装目录c:\Program files\winrar\Rarexe,按“确定“。

第二步:在“请键入快捷方式名称”那里,键入快捷方式的名称“Rar关机(或者自己喜欢的名字)”,点击“完成”返回桌面。

第三步:右击“Rar关机”快捷方式,选择“属性”,在“快捷方式”标签下“应用程序”的目标文本框c:\Program files\WinRAR\Rarexe后加入命令“-ioff”,注意Rarexe和-ioff用空格隔开,在“运行方式”窗口选择“最小化”,按“确定”。 第四步:要关机时,只要双击“关机”快捷方式,WinRAR就会自动关闭系统。

需要注意的是,要实现关机功能,需要使用WinRAR 311以上版本。以上方法同样适用Windows 98/XP。

在这里你可以点击更改图标选项,选折一个自己喜欢的图标,还可以在快捷键里面键入一个关机键,我的是f12,这样按f12就可以关机了。

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

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

shutdown / 看看帮助信息。

C:\Windows\system32>shutdown /

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)

Windows XP(Windows 2000也可以)自身就具备定时关机的功能,下面我们就来看看如何实现Windows XP的自动关机。

Windows XP的关机是由Shutdownexe程序来控制的,位于Windows\System32文件夹中。如果想让Windows 2000也实现同样的效果,可以把Shutdownexe复制到系统目录下。

比如你的电脑要在22:00关机,可以选择“开始→运行”,输入“at 22:00 Shutdown -s”,这样,到了22点电脑就会出现“系统关机”对话框,默认有30秒钟的倒计时并提示你保存工作。如果你想以倒计时的方式关机,可以输入“Shutdownexe -s -t 3600”,这里表示60分钟后自动关机,“3600”代表60分钟。

设置好自动关机后,如果想取消的话,可以在运行中输入“shutdown -a”。另外输入“shutdown -i”,则可以打开设置自动关机对话框,对自动关机进行设置。

Shutdownexe的参数,每个都具有特定的用途,执行每一个都会产生不同的效果,比如“-s”就表示关闭本地计算机,“-a”表示取消关

机 *** 作,下面列出了更多参数,大家可以在Shutdownexe中按需使用。

用法: shutdown [-i | -l | -s | -r | -a] [-f] [-m \\computername] [-t xx] [-c "comment"] [-d up:xx:yy]

没有参数 显示此消息(与 相同)

-i 显示 GUI 界面,必须是第一个选项

-l 注销(不能与选项 -m 一起使用)

-s 关闭此计算机

-r 关闭并重启动此计算机

-a 放弃系统关机

sorry 只知道这些了。

以上就是关于如何编写一个自动关机的程序全部的内容,包括:如何编写一个自动关机的程序、怎样制作一个计算机关机的程序、java怎么实现远程关闭计算机,远程唤醒的做好了,远程关机的不知道该怎么做等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/zz/10161450.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-05
下一篇 2023-05-05

发表评论

登录后才能评论

评论列表(0条)

保存