How to use VB to write an automatic shutdown program with 10 seconds as a countdown, count to 0 and

Updated on technology 2024-03-24
10 answers
  1. Anonymous users2024-02-07

    shell ("shutdown -s -t 360") 'It means that it will turn off after 360 seconds.

    Note: -s is to shut down, -l is to log out, and -r is to restart.

  2. Anonymous users2024-02-06

    private sub command1_click()if = "Get started" then

    truetext1 = val(text1) *60= "Stop"

    else false

    Get started"end if

    end sub

    private sub timer1_timer()text1 = text1 - 1

    if text1 = "0"then = false: call to shut down.

    end sub

    sub Shutdown ().

    shell " /c shutdown -s -t 0"

    msgbox "Shut down"

    end sub

  3. Anonymous users2024-02-05

    - - Upstairs is too troublesome private sub command1 click().

    a = str(val( *60)

    shell "shutdown -s -t" + aend subprivate sub command2_click()

    shell "shutdown -a"

    end sub

    Just tried absolutely

  4. Anonymous users2024-02-04

    If you use xp, for example, shut down after 1 hour, then start running shutdown -s -t 36003600 how many seconds will it shut down, 1 hour is 3600, 2 hours is 7200, and so on Vista can't be used.

  5. Anonymous users2024-02-03

    I tried it on the XP question.

    Change it this way.

    dim i as long

    private sub command1_click()i = 20

    true iend sub

    private sub form_load()= false

    end sub

    private sub timer1_timer()= i

    if i > 0 then

    i = i - 1

    else false

    msgbox "It's time! "

    end if

    end sub

  6. Anonymous users2024-02-02

    You copy the ** and see. **Can't see clearly.

    There must be something wrong with it.

    This app is very simple.

  7. Anonymous users2024-02-01

    To fully meet your requirements, you need the source file to give the address.

  8. Anonymous users2024-01-31

    Create a new form from1 and a button command1

    Add a timer1 control and two labels (countdown x hours x minutes) (to show the current time).

    hours) minutes) text3 (seconds).

    ..Zhang Zhichen: .**。

    dim t$

    private sub command1_click()

    t is the time when the device is set to be shut down.

    t = text1 & ":" & text2 & ":" & text3

    Start the timer control and start the countdown.

    trueend sub

    private sub form_load()

    Set the time interval for the timer control to 1 second.

    When the program is started, the timer is not available.

    falseend sub

    private sub timer1_timer()

    Countdown, set the difference between the time and the current time.

    timelabel = format(cdate(t) -time, "hh:mm:ss")

    Displays the current system time.

    nowlabel = time

    If the time difference is 0, it will be shut down immediately!!

    if timelabel = "00:00:00" then shell "shutdown -s -t 0"

    end sub

  9. Anonymous users2024-01-30

    Start Running cmd pop-up window Enter the command on it, no programming is required.

    For example, at 11:55 shutdown -s means that the computer will shut down at 11:55, and a reminder will be sent one minute before. S is changed to a to terminate the scheduled task.

  10. Anonymous users2024-01-29

    Create a label control on the form label1 and a timer control timer1dim sec as long

    private sub form_load()= 1000

    sec = 600 'here modified to the countdown time you need label1 = sec &"Shut down after seconds"

    end sub

    private sub timer1_timer()sec = sec - 1

    label1 = sec & "Shut down after seconds"

    if sec <= 0 then

    shell "shutdown -s -f -t 0"

    end if

    end sub

Related questions
7 answers2024-03-24

Use cmd's timer to shut down.

private void button1_click(object sender, eventargs e) >>>More

19 answers2024-03-24

If you are using a Huawei phone, we recommend that you do the following: >>>More

6 answers2024-03-24

In the event of an automatic restart of Apple, it is recommended to deal with it in the following ways: >>>More

7 answers2024-03-24

Hello, sorry for the inconvenience.

If you want to recall whether the automatic restart occurs under a specific operation or software, we recommend that you perform the following simple troubleshooting: >>>More

14 answers2024-03-24

You can directly turn off the cool.