-
Don't use command, a timer, set interval 1000
timer1_time()
dim h,m,s,t
h=m=s=t=h & ":" & m & ":" & sif then
shell "shutdown -s -t 0" 'Shutdown.
end if
end sub
-
There may be a problem on the 1st floor, but I think it should be if then!
-
Leave an email to send you an example.
-
It's very simple, create a new form, draw a timer control, set interval to 1000, and say you want to turn off the computer at 8 p.m. every day, then write the following consttas directly in the ** area
string="20:00"
To modify the shutdown time, please modify it here, private
subform_load()
endsub
private
subtimer1_timer()
iftime(now)=t
thenshell
shutdown
s-ft1"
endifendsub
The above is**,**Please ask if you don't understand.
-
The main thing is this: shell"shutdown -s -t 0"
The rest of the timerbox can be done,
-
I do, but the interface isn't very good.
-
Shutdown is: shell(" -s -t 0")
You don't need me to write it on a regular basis, right?
-
private sub command1_click()dim j as integer
j = msgbox("Is it really a computer turned off? ", 36, "Tips")t = 5 '5 seconds.
if j = 6 then
shell " /c shutdown -s -t " & tend if
end sub
Your time variable i can't be in quotation marks, it should be outside the quotation marks, concatenated by a conjunction, note that there are spaces between the parameters.
-
option explicit
dim atime as date
private sub form1_load()
falseend sub
private sub command1_click()
if + = "" then
msgbox "Please enter a number", ,"Tips"
elseatime = dateadd("h", val(, now)
atime = dateadd("n", val(, atime)
You will be in:" & atime & "Shutdown. "
trueend if
end sub
private sub command2_click()
end 'Exit the program.
end sub
private sub form_load()
1000 'The timer event is executed every 1 second.
falseend sub
private sub text1_change()
falseend sub
private sub text3_keypress(keyascii as integer)
if keyascii <>8 and keyascii < asc(0) or keyascii > asc(9) then keyascii = 0
end sub
private sub text2_keypress(keyascii as integer)
if keyascii <>8 and keyascii < asc(0) or keyascii > asc(9) then keyascii = 0
end sub
private sub timer1_timer()
now 'The time is updated once after each timer
if atime >= now then shell "cmd /c shutdown -s -t 0", 0
end sub
-
The ** at the timer is changed to this.
private sub timer1_timer()= now
if atime = "" then exit subif datediff("s", atime, now) >= 0 then
shell "c:\windows\system32\ -s", 1end if
end sub
-
private sub form_load()shell("shutdown -s -t 3600")'3600 seconds shutdown.
end sub
Remember to give extra points!!
The shell can be followed by some commands in cmd.
Oh, then I can't help it, I'm not a master, sorry
In the case of XP systems, there are files in XP.
That is to say, if that machine has it, that machine can execute this order. >>>More
There's a very simple way to do it.
Here are the common shutdown commands: >>>More
How to set the computer to time and shut down.
Let's talk about one that changes every two seconds.
Set it directly in the form. >>>More
Be a true lifelong reader.
Excerpt) The reader is a beautiful identity, and everyone has other identities in his life, and if he is also a reader, it is perfect. >>>More