will this code make the pc shut down with out prompting the user if it does more plz tell me and tell me the exact line and places where i have to put it for it to work please thanks if u can help that would be great it is just that i bundled the code together as a rough idea cos i got sum code and edited it so i hope it is right
[blue]
Public Sub LogOff(Force As Boolean)
On Error GoTo skip
Dim SM As New clsShut
Select Case Force
Case True
SM.ForceLogoff
Case False
SM.LogOff
End Select
skip:
End Sub
[/blue]
from
mark
Comments
: will this code make the pc shut down with out prompting the user if it does more plz tell me and tell me the exact line and places where i have to put it for it to work please thanks if u can help that would be great it is just that i bundled the code together as a rough idea cos i got sum code and edited it so i hope it is right
: [blue]
: Public Sub LogOff(Force As Boolean)
: On Error GoTo skip
: Dim SM As New clsShut
: Select Case Force
: Case True
: SM.ForceLogoff
: Case False
: SM.LogOff
: End Select
: skip:
: End Sub
: [/blue]
: from
: mark
:
Do you happen to have the code for the clsShut?
Also check out the posts on the bottom of this page or in the next one, there is a thread on forcing shutdowns.
[blue]
C:Dos
C:Dos Run
Run Dos Run
[/blue]
: : will this code make the pc shut down with out prompting the user if it does more plz tell me and tell me the exact line and places where i have to put it for it to work please thanks if u can help that would be great it is just that i bundled the code together as a rough idea cos i got sum code and edited it so i hope it is right
: : [blue]
: : Public Sub LogOff(Force As Boolean)
: : On Error GoTo skip
: : Dim SM As New clsShut
: : Select Case Force
: : Case True
: : SM.ForceLogoff
: : Case False
: : SM.LogOff
: : End Select
: : skip:
: : End Sub
: : [/blue]
: : from
: : mark
: :
:
:
: Do you happen to have the code for the clsShut?
:
: Also check out the posts on the bottom of this page or in the next one, there is a thread on forcing shutdowns.
: [blue]
: C:Dos
: C:Dos Run
: Run Dos Run
well no i have not sorry do u have anyt code that will do it easily i have looked down at that topic and that is where i got the idea from but it was no gud for my exact perpose if possible wot is a restart one if u no plz
thanks from
mark
: : : will this code make the pc shut down with out prompting the user if it does more plz tell me and tell me the exact line and places where i have to put it for it to work please thanks if u can help that would be great it is just that i bundled the code together as a rough idea cos i got sum code and edited it so i hope it is right
: : : [blue]
: : : Public Sub LogOff(Force As Boolean)
: : : On Error GoTo skip
: : : Dim SM As New clsShut
: : : Select Case Force
: : : Case True
: : : SM.ForceLogoff
: : : Case False
: : : SM.LogOff
: : : End Select
: : : skip:
: : : End Sub
: : : [/blue]
: : : from
: : : mark
: : :
: :
: :
: : Do you happen to have the code for the clsShut?
: :
: : Also check out the posts on the bottom of this page or in the next one, there is a thread on forcing shutdowns.
: : [blue]
: : C:Dos
: : C:Dos Run
: : Run Dos Run
:
:
: well no i have not sorry do u have anyt code that will do it easily i have looked down at that topic and that is where i got the idea from but it was no gud for my exact perpose if possible wot is a restart one if u no plz
: thanks from
: mark
:
Try this in a code module
[code]
Declare Function ExitWindowsEx Lib "user32" (ByVal uFlags As Long, ByVal dwReserved As Long) As Long
Public Const EWX_FORCE = 4
Public Const EWX_LOGOFF = 0
Public Const EWX_REBOOT = 2
Public Const EWX_SHUTDOWN = 1
[/code]
and then where ever you want to shutdown:
[code]
ExitWindowsEx EWX_SHUTDOWN, 0
[/code]
works for 98, not sure how to do it for xp - I belive as it is there will be no option for the victim to stop it.
[blue]
C:Dos
C:Dos Run
Run Dos Run
[/blue]