Restart computer?

[b][red]This message was edited by saint_dev at 2003-3-10 20:48:54[/red][/b][hr]
[Edit]
Ok I've been looking for the answer to that for weeks, but right after I posted I figured it out. My question now is does anyone know a way to restart a computer using VB.Net on both 9x and XP/2000?
[/Edit]

Hi I'm trying to delete a file on restart using the MoveFileEx API in VB.Net. If I pass a name as the second argument it works fine and renames the file on reboot like it should. If I try to pass it a Null (using Chr(0)) for the second file name it returns that it failed, and the registry key is not written. Using GetLastError I get error number 3 "Path not found". Could someone please help me figure out what is up with this?


Comments

  • : [b][red]This message was edited by saint_dev at 2003-3-10 20:48:54[/red][/b][hr]

    System.Diagnostics.Process.Start("C:WindowsSystem32shutdown.exe")
    (for shutdown the pc)
    for restart pc, i don't know which exe file is...you can find inside the directory, it might be relog or reset or something.


    : [Edit]
    : Ok I've been looking for the answer to that for weeks, but right after I posted I figured it out. My question now is does anyone know a way to restart a computer using VB.Net on both 9x and XP/2000?
    : [/Edit]
    :
    : Hi I'm trying to delete a file on restart using the MoveFileEx API in VB.Net. If I pass a name as the second argument it works fine and renames the file on reboot like it should. If I try to pass it a Null (using Chr(0)) for the second file name it returns that it failed, and the registry key is not written. Using GetLastError I get error number 3 "Path not found". Could someone please help me figure out what is up with this?
    :
    :
    :

  • Thanks, but I was looking for a way to restart using the API. And shutdown.exe (2000/XP Only) will shutdown/restart/log off pc. You just need to specify argument -r to restart. I still would like to do it with API though.

    : System.Diagnostics.Process.Start("C:WindowsSystem32shutdown.exe")
    : (for shutdown the pc)
    : for restart pc, i don't know which exe file is...you can find inside the directory, it might be relog or reset or something.
  • : Thanks, but I was looking for a way to restart using the API. And shutdown.exe (2000/XP Only) will shutdown/restart/log off pc. You just need to specify argument -r to restart. I still would like to do it with API though.
    :
    : : System.Diagnostics.Process.Start("C:WindowsSystem32shutdown.exe")
    : : (for shutdown the pc)
    : : for restart pc, i don't know which exe file is...you can find inside the directory, it might be relog or reset or something.
    :

    : FYI, shutdown.exe is not included in the windows os environment, it is included in nt's resource kit, try using API's function for that matters. also i have a shutdown.exe file that can do that two options. (shutdown and restart)...



  • [b][red]This message was edited by saint_dev at 2003-4-2 0:38:50[/red][/b][hr]
    : : FYI, shutdown.exe is not included in the windows os environment, it is included in nt's resource kit, try using API's function for that matters. also i have a shutdown.exe file that can do that two options. (shutdown and restart)...



    Yes as I said I was looking for a way to restart using API...If you would be willing to post an example of how to shutdown/restart using the API it would be a great help. I can not for the life of me figure out how to do it (I'm using XP by the way). And shutdown.exe is included with XP by default.




Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories