定时关机工具,bat管道命令

import win.ui;
import process.popen; //使用process.popen(cmd)不会闪黑窗
/*DSG{{*/
mainForm = win.form(text="定时关机程序";right=582;bottom=206;mode="popup")
mainForm.add(
button={cls="button";text="执行";left=42;top=154;right=211;bottom=187;z=1};
button2={cls="button";text="取消";left=310;top=158;right=481;bottom=187;z=6};
edit={cls="edit";text="0";left=164;top=62;right=235;bottom=93;align="center";edge=1;multiline=1;z=5};
edit2={cls="edit";text="0";left=294;top=60;right=369;bottom=93;align="center";edge=1;z=8};
groupbox={cls="groupbox";text="定时关机";left=25;top=10;right=555;bottom=142;edge=1;z=2};
static={cls="static";text="Static";left=74;top=78;right=164;bottom=79;transparent=1;z=3};
static2={cls="static";text="倒计时";left=69;top=64;right=171;bottom=92;font=LOGFONT(h=-18);transparent=1;z=4};
static3={cls="static";text="分";left=255;top=68;right=312;bottom=88;font=LOGFONT(h=-18);transparent=1;z=7};
static4={cls="static";text="秒";left=398;top=68;right=433;bottom=89;font=LOGFONT(h=-18);transparent=1;z=9}
)
/*}}*/

mainForm.button.oncommand = function(id,event){	
	var time=mainForm.edit.text*60+mainForm.edit2.text ; 
	var cmdc ="shutdown -s"+" -t "+ time ; 
	//mainForm.msgbox(cmdc)
	process.popen(cmdc);
}

mainForm.edit.oncommand = function(id,event){
	
}

mainForm.button2.oncommand = function(id,event){
	 
	process.popen("shutdown -a");
	mainForm.msgbox("计划已取消")
	
}

mainForm.edit2.oncommand = function(id,event){
	
}

mainForm.show();
return win.loopMessage();

  

  

 

转载于:https://www.cnblogs.com/yaoyue68/p/9997452.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值