Restart only the Windows OS (not the whole computer) via .NET? [closed] - c#

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
I know that it's possible to manually restart only Windows by holding down the Shift key, clicking restart and then the OK button, but is there a way to do this programatically in a .NET app?

I assume you're referring to this microsoft knowledgebase article about restarting windows without restarting the PC - which is also referenced here on wikipedia ?
You'll note that this refers only to windows 95, 98 and ME. It makes sense in that context, as those versions of windows ran on top of MS-DOS, and so I'm assuming that it restarted the windows layer without restarting the DOS layer underneath it.
On later versions of windows, holding the shift key will have no effect, as they don't run on top of DOS. Restarting windows is restarting the whole computer, as there's no "layer underneath it". If you're still using windows 95, 98 or ME... umm... good luck and have a nice life?

Related

How to run windows service on Linux or Mac OS [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 1 year ago.
Improve this question
I have created windows service and it is working fine on Windows OS ,but we need to run this same service on Linux or Mac OS.
It is possible ?
Linux or macOS has its own way to manage "services", via systemd or supervisor or other mechanisms. Thus, you won't be able to ship the Windows app to such platforms, but you can write a .NET Core console app based on the same logic and then put it under systemd or the desired tool on such OS.
Obviously "possible", in the worst case reprogramming from scratch. I'm guessing the winforms tag you've used suggests what you think the biggest porting headache will be. Maybe check out C# WinForms application to linux which seems to be asking that same question. An even easier approach might (emphasize "might") be to run virtualbox https://www.pcsteps.com/184-install-virtualbox-linux-mint-ubuntu/ (or see many similar pages, and many similar vm's) under linux, and then just run your service on a windows virtual machine.

C# Console App .exe Not Running Outside of Visual Studio [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 years ago.
Improve this question
I'm trying to run my .exe file for a console app I made. When I go to /bin/debug/~~~.exe it won't run. However, it still manages to build from inside Visual Studio.
How can I get this to work?
I have experienced the same situation, my exe is just a simple Hello World console. After a lot of trials and errors, I figured out it is just my antivirus (Avast Free Antivirus) pausing it. Whitelisting my exe solves the problem. Hope it is your case too.
Its my antivirus which is blocking my application. After uninstalling everything is working properly.

Winform viewing [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
Since I add an extra screen to my developpment laptop and set an extended desktop, the view of the forms change by the way it show in the picture below two form with same code in windows 8
The lower screen is displayed in windows classic style. Your windows 8 switches from theme when you connect a extra screen to it (It could be because your pc is low on certain resources like RAM, or just because...well its Windows). You can change it back to get old default theme (howto here: http://windows.microsoft.com/en-us/windows-8/get-started-with-themes ).
Keep in mind tough that it is wise to test your form application with differed themes. You already have one control that gets pretty much useless in classic mode.

Access network card power management properties [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
Is there a way to access a list of network adapters, check if they have power management options, then change those options.
Example: Allow the computer to turn off this device to save power?
I need to check if the above option is turned on, if so turn it off?
Need a solution or multiple solutions that will work with Windows XP - Win8.1
Briefly, you have to:
Get network adapters list
Get according options from system registry: Adjusting Power Settings in Windows XP SP3 via Registry.
Change them in appropriate order: How to: Create a Key In the Registry (Visual C#).

how to know when a new Antivirus has installed on windows [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I want to monitor the event of a new Antivirus installation ,
currently what I have in mind is listen to change in the Uninstall registry folder and then compare the new application name with a list of known Antiviruses.
I want to improve it by being more specific , is there other resource I can monitor in order to know when a new Antivirus has installed? for example some registry that new Antivirus have to edit in order to be marked as an active Antivirus etc.
Thank you for your help
Registry is not the best way. The information you want is usually exposed through the WMI.
Since you haven't specify in tags what language you're using, here's the link to the VBScript example. Beware that on 64 bit OSes there're effectively 2 WMIs, 32 bits and 64 bits.
If you want your software to react instantly, WscRegisterForChanges API allows you to be notified when the AV is started or stopped.

Categories

Resources