VB master, please come in, I urgently need a shutdown program programmed in VB!

Updated on technology 2024-04-19
10 answers
  1. Anonymous users2024-02-08

    **:under command1

    shell " /c shutdown -s -f -t 0", ** under 0command2.

    unload me

  2. Anonymous users2024-02-07

    1 All glngwhichwindows32 = mlngwindowsnt is to judge the system platform, whether it is NT system.

    NT system uses AdjustToken to obtain permission verification.

    shutdown uses the shutdown parameter ?

    Usage: shutdown [-i |.] l | s | r | a] [f] [m \\computername] [t xx] [c "co

    mment"] [d up:xx:yy]

    There is no parameter to display this message (with ?.)Same)

    i Displays the GUI interface, which must be the first option.

    l Log out (cannot be used with option -m).

    s shut down this computer.

    r Shut down and restart this computer.

    a Abandon system shutdown.

    m computername remote computer shutdown reboot give up.

    The timeout for the t xx setting to turn off is xx seconds.

    c "comment"Turn off comments (up to 127 characters).

    f Force running applications to close without warning.

    d [u][p]:xx:yy Reason for closure**.

    u is the user**.

    p is a planned closure**.

    xx is a major reason** (a positive integer less than 256).

    yy is a secondary reason** (a positive integer less than 65536).

  3. Anonymous users2024-02-06

    shell "cmd /c shutdown -u -t 1"

    Call the cmd implementation.

    It turns off after 1 second.

    v = msgbox("Are you sure you want to shut it down? ", vbyesno + vbquestion, "???") 'A yes and no dialog box pops up.

    if v = vbyes then 'If the click is if glngwhichwindows32 = mlngwindowsnt then'External view, such as equal.

    adjusttoken 'External procedures or functions.

    end if

    shell "cmd /c shutdown -u -t 1" 'Shut down after 1 second after calling cmd.

    end if

  4. Anonymous users2024-02-05

    You don't need an API, you just need a shell.

    private sub form_laod()shell("shutdown -s -t 300")'300 seconds shutdown end sub

  5. Anonymous users2024-02-04

    Hehe,You can also program this program.,I've learned VB for so many years.,It's used to do management systems and**,Hehe, I haven't really done the operating system tools.

  6. Anonymous users2024-02-03

    First, declare the API function ExitWindowEx:

    declare function exitwindowex lib "user32"(byval uflags as long,byval swreserved as long)as long

    The shutdown is exitwindowex(ewx shutdown,0) and the reboot is exitwindowex(ewx reboot,0)example:

    private sub shut_click()dim abc as long

    unload me

    abc = exitwindowex(ewx_shutdown,0)end sub

  7. Anonymous users2024-02-02

    if msgbox("Are you sure you want to shut it down? ", vbokcancel + vbquestion, "System Information") = vbok then

    shell "cmd /c shutdown -u -t 1", vbnormalfocus

    end if

  8. Anonymous users2024-02-01

    Simple:

    Inside the shutdown it is written: shell"cmd /c shutdown /s /t 0", vbhide

    Restart it and write :shell"cmd /c shutdown /r /t 0", vbhide

    Inside the logout writes: shell"cmd /c shutdown /l /t 0", vbhide

  9. Anonymous users2024-01-31

    You can call the shutdown command, first of all, you open the three bat files of Notepad, including "shutdown", "restart" and "logout", for example: save them as follows: ,

    Write ** in Notepad as follows (write in three Notepads and then save as):

    Logout: shutdown -l

    Shutdown: shutdown -s

    Restart: shutdown -r

    Above, when used, it is directly called with the shell, such as the shutdown command, **is:

    private sub command1_click()shell"d:\"'Write which path exists.

    end sub

  10. Anonymous users2024-01-30

    This requires the use of api functions, it is recommended to read similar tutorials, or leave an email, and I will send you a copy of what I did before.

Related questions
11 answers2024-04-19

Insert 3 texts, 1 command

private sub form_load()= "1000" 'Blood volume. >>>More

5 answers2024-04-19

Parameter description: rndnumcount, the number of 6 digits; mysearchnum, the number to look for. >>>More

20 answers2024-04-19

Because the class hasn't been initialized yet.

class1 has a property called c2, and the type is class2; There is a property called integer, and the type is integer; >>>More

6 answers2024-04-19

i=1,j=1:x(1,1)=x(0,0)+1+1=2i=1,j=2:x(1,2)=x(0,1)+1+2=3...

i=1,j=5:(x,5)=x(0,4)+1+6=6--- >>>More

11 answers2024-04-19

option explicit

dim x as control >>>More