Start an exe. via Windows Service [duplicate] - c#

This question already has answers here:
How can I run an EXE program from a Windows Service using C#?
(9 answers)
Closed 5 years ago.
I'm currently working on a project to automatize my backup to run only under certain circumstances. Therefor I'm writing a Windows Service in C# using Visual Studios 2015. I already got my requirements set and now I can't get my Service to run sdclt.exe (the Microsoft Default Backup). I already searched for a solution but i only found people saying that Windows Services can't start .exe anymore. Does anyone here have an idea how it might still work?
Thank You

you can create BatchFile that Run sdclt.exe or use System.Thredin.Process to Run that exe. use verbs if require to run with administrator rights.

Related

How to run my c# console application on someone else's computer [duplicate]

This question already has an answer here:
When do i need to download the .Net core Runtime?
(1 answer)
Closed 2 years ago.
So a really basic question:
I wrote a c# console app. Not completly basic. There several classes outside the Programm.cs.
Now I wanted to show it to some friends so I send them zipped folder and and told them to go into \bin\Debug\netcoreapp3.1 and open the .exe file.
This works for me, but not for 2 of my friends who tried it.
A new windows opens and closes right away.
They seem to have the .Net framework installed.
Is there a way to open it without having install visual studio?
Thanks
Solved:
The issue was that .Net Core Desktop Runtime wasn't installed
Thanks everyone
You should publish your project. You will find the option to publish based on your visual studio.
Once your code is published, open \bin\release\netcoreapp3.1\publish..
And share this complete published folder

Is it possible to run a python file from within Visual Studio? [duplicate]

This question already has answers here:
How do I run a Python script from C#?
(9 answers)
Closed 7 years ago.
I am completely new to Visual Studio and C#, so I apologize in advance if this sounds like a dumb question. I am trying to develop a Windows Forms Application such that when I click a button, a Python script is run, performing data analysis on some files, with the eventual goal of displaying that data as a graph on the Windows Forms Application after the button is clicked.
My question is: how do I get the python script to run when the button is clicked from the Windows Forms Application?
Yes, it is possible.
You can create a process that runs python shell.
Pyton Tools for Visual Studio will help with debugging python from within VS
https://pytools.codeplex.com/
For more details and how to look at this video
http://www.youtube.com/watch?v=JNNAOypc6Ek&hd=1
Yes, it is possible there is Microsoft approved extension for VS to yse Python.
You can downloaded it from here:
https://visualstudiogallery.msdn.microsoft.com/9ea113de-a009-46cd-99f5-65ef0595f937
For more details and how to look at this video
http://www.youtube.com/watch?v=JNNAOypc6Ek&hd=1

C# console and windows application [duplicate]

This question already has answers here:
How to run a .NET console application in the background
(8 answers)
Closed 8 years ago.
Is there any way to run both windows and console application while debugging C# project in Visual Studio 2013? I'm trying to run an XNA project if that helps in any way.
Thank you
If they are in the same solution you can set multiple projects on startup in the solution properties.
You could build one of them and run the executable directly from the debug folder while debugging the other project. Alternatively there's some information here on switching between processes while debugging: http://msdn.microsoft.com/en-us/library/jj919165.aspx

Code isn't executing in windows Service [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
How to start a process from windows service into currently logged in user’s session
c# windows service
I have this code in the OnStart Method of the windows service.
System.Diagnostics.Process.Start("notepad.exe");
I am successfully able to start the windows service. However once the service has successfully started it doesn't open the notepad.
This is a strange problem and as i am new to windows services, help is required.
Windows services don't execute in the same context as the desktop.
Hence you won't see the application running in explorer like you would if you launched it normally.

How to set run as Administrator for Csharp Windows Form exe [duplicate]

This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
How to force C# App to run as administrator on Windows 7
I had already done my codes and it's ready to Decode, however, i needed the pogramme to run as administrator. The question is how to make the program to enable RUN AS ADMINISTRATOR?
Add a manifest file to project with these contents

Categories