Search code examples
vb.netvisual-studio-2012system-shutdown

System.Diagnostics.Process.Start("Shutdown", "-s") not working in visual basic


i am writing visual basic application in visual studio 2012 to turn of the computer. i have used syntaxes like

 1. System.Diagnostics.Process.Start("Shutdown", "-s") 
 2.System.Diagnostics.Process.Start("Shutdown", "/s")

 3. Process.Start("shutdown", "/s /f /t 01")
 4. Shell("shutdown -s -t 00")

but all instead of shutting down reruns the same application again and computer dont shutdown only.what might be the solution for it so that it will work

thanks in anticipation


Solution

  • Rename your application executable file from shutdown to something else because in case of the name shutdown, it hides system wide shutdown command.