Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 398225
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T16:43:39+00:00 2026-05-12T16:43:39+00:00

Is it possible, without employing pinvoke, to restart a PC using .NET? I kind

  • 0

Is it possible, without employing pinvoke, to restart a PC using .NET?

I kind of just repeated the title, but I’m not too sure how to elaborate much further!

Edit:

I should have mentioned that don’t want to use “shutdown -r” as a solution.

I was really after a pure .NET way, something like:

Environment.ShutDown();

In other words, something that is maintained with .NET as new versions of Windows arise.

Edit 2:

Please stop asking “what’s wrong with p/invoke”. Those sort of answers are exactly what SO users seem to love; the supposed “lateral” approach to answering a question. However, although there is no real problem with p/invoke and I will happily use it, what on earth is wrong with asking if .NET has a more official way of achieving something? If it’s in .NET then any API changes between OSes will (most likely) get reflected. Whatever the reason, it’s not a crime to seek to minimise DLL import usage is it?

I’m sure if I included something in a question like:

[DllImport("something32.dll")]
static extern int ClimbWall32Ex(IntPtr32 blah);

And you could just do:

SomeNamespace.ClimbWall();

Everyone one here would scream: “what is wrong with using SomeNamespace.ClimbWall();??”

Sigh.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T16:43:39+00:00Added an answer on May 12, 2026 at 4:43 pm

    You need to call ExitWindowsEx which is only available through DllImport

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

not sure if this is possible without having to go through several passes, but
Possible Duplicate: Using ASP.NET Controls without databinding My previous question yielded few results so
I'm not sure what I'm trying to do is possible without php or some
I'm not sure if this is possible without Flash... Basically, is there a way
Is it possible without using triggers (if not then a working trigger would still
I am not sure this is even possible without modifying the Admin interface. I
I don't think this is possible without a bit of hacking but just throwing
Is it possible without using exponentiation to have a set of numbers that when
Is it possible in IE8 without using third party plugin like Java?
Possible Duplicate: Modify the URL without reloading the page I just came across this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.