i have written an app that starts with windows as the shell.
the user then has to wait for it to restart windows.
how do i restart windows in the app?
can i use the api if the explorer shell was not loaded ?
i have tried the code below , but it just freezes the pc
plz can somebody help urgentlyCode:Option Explicit Private Declare Sub Sleep Lib "kernel32" _ (ByVal dwMilliseconds As Long) Private Sub Form_Load() 'this app gets called from my other app which started as ' the windows shell. When that app closes , then it calls 'this one to restart windows. Sleep 3000 Label1.Caption = "Setting up Explorer..." Name "c:\windows\explorer.exe" As "c:\windows\desklok.exe" 'rename my "explorer.exe" to "desklok.exe" Sleep 500 Name "c:\windows\desklok.qaz" As "c:\windows\Explorer.exe" 'rename original "Explorer.exe" from "desklok.qaz" Sleep 500 Label1.Caption = "Starting Windows..." Sleep 500 Shell ("rundll user,exitwindowsexec") 'here it hangs Sleep 2000 Unload Me Set winex = Nothing End End Sub
thankz




Reply With Quote