- Katılım
- 25 May 2018
- Mesajlar
- 1,610
- En iyi yanıt
- 14
- Puanları
- 113
- Konum
- İstanbul
- Web sitesi
- excelarsivi.com
- Ad Soyad
- Murat OSMA
- Office Vers.
- Microsoft 365 TR+EN
Windows'u kapatmak, yeniden başlatmak, oturumu sonlandırmak gibi işlemleri bu kodlarla yapabilirsiniz.

PHP:
#If VBA7 And Win64 Then
Public Declare PtrSafe Function ExitWindowsEx Lib "user32" (ByVal uFlags As Long, ByVal dwReserved As Long) As Long
#Else
Public Declare Function ExitWindowsEx& Lib "User32" (ByVal uFlags&, ByVal wReserved&)
#End If
Global Const EWX_FORCE = 8
Global Const EWX_LOGOFF = 0
Global Const EWX_REBOOT = 2
Global Const EWX_SHUTDOWN = 1
Dim Komut
Sub Windowsu_Kapat()
On Error Resume Next
Komut = ExitWindowsEx(EWX_SHUTDOWN, 0&)
End Sub
Sub Windowsu_Kapatma_Ekranı()
On Error Resume Next
CreateObject("Shell.Application").ShutdownWindows
End Sub
