Restart a service

ntnt Member Posts: 160
hi,
someone knows what is the code to restart a windows service from a codeunit?

thanks.

Comments

  • MagnoMagno Member Posts: 168
    use the shell function and use the dos command "net start <servicename>"
    There are no bugs, only random undocumented features...
    ---
    My Blog: http://NAV-Magno.be
  • ntnt Member Posts: 160
    thanks.
    i try to do this,and it opens a windows shell, saying that the is starting...
    but the status of the service dont change.....in the Computer Management/Services i want to see Started in the service.
  • krikikriki Member, Moderator Posts: 9,118
    Has your service the correct login to be able to start?

    Did you already have open the services before starting the service? In this case you have to refresh.
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • ntnt Member Posts: 160
    yes already refresh....if i start the service in services he start.
Sign In or Register to comment.