I want to use VB to make a timed shutdown tool

Updated on technology 2024-04-11
11 answers
  1. Anonymous users2024-02-07

    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

  2. Anonymous users2024-02-06

    There may be a problem on the 1st floor, but I think it should be if then!

  3. Anonymous users2024-02-05

    Leave an email to send you an example.

  4. Anonymous users2024-02-04

    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.

  5. Anonymous users2024-02-03

    The main thing is this: shell"shutdown -s -t 0"

    The rest of the timerbox can be done,

  6. Anonymous users2024-02-02

    I do, but the interface isn't very good.

  7. Anonymous users2024-02-01

    Shutdown is: shell(" -s -t 0")

    You don't need me to write it on a regular basis, right?

  8. Anonymous users2024-01-31

    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.

  9. Anonymous users2024-01-30

    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

  10. Anonymous users2024-01-29

    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

  11. Anonymous users2024-01-28

    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

Related questions
15 answers2024-04-11

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

13 answers2024-04-11

There's a very simple way to do it.

Here are the common shutdown commands: >>>More

6 answers2024-04-11

How to set the computer to time and shut down.

18 answers2024-04-11

Let's talk about one that changes every two seconds.

Set it directly in the form. >>>More

8 answers2024-04-11

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