I'm trying to make a simple application in C# that allows me to kill and enable explorer.exe. I need such program so that I can play Age of Empires 2 properly, because it does not like explorer.exe for some reason (I believe it has to do with Aero).…
I am using this Impersonator class to impersonate a domain account to access a network share like so:
using(new Impersonartor(username, domain, password))
{
//Code Here
}
Copying the file from the network share works okay:
using(new…
This
var psi = new ProcessStartInfo("cmd")
{
Verb = "runas",
UseShellExecute = true,
Arguments = "/user:domain\\username"
};
var ps = Process.Start(psi);
does not start…
When I try to start Firefox using Process.Start and ProcessStartInfo (.NET) everything seems to work fine. But when I specify a username and password of another account (a member of Users), nothing seems to happen. The same code works fine with…
After some poking around on how to reset my computer and or shut it down from C# I found this explanation on how to do that:
ManagementBaseObject outParameters = null;
ManagementClass sysOS = new…
The short story is I'm writing a front-end for the emulator MAME as a study in WPF and C#.
The GUI is set, it's reading cfg's properly, everything is fine except for actually launching MAME.
From the command line (Windows 7) I can type the…
First off i have checked the web to try and find an answer however i have only come across people who want to run their processes in the background whereas my issue here is the opposite way round.
I have entered the following code on my controller…
I have a utility that I have written in VB.net that runs as a scheduled tasks. It internally calls another executable and it has to access a mapped drive. Apparently windows has issues with scheduled tasks accessing mapped drives when the user is…
Update (3/20/2014 5:11PM EST): have added code to write "GotHere0.txt". Gothere0, 1, 2, 3 all appear fine. Gothere4 does not appear.
Please note - this is not a duplicate - it has very subtle differences with all existing threads I have…
I want to open a text file programmatically using C#. I have used :
System.Diagnostics.Process.Start(test.txt);
but this code is causing OS command injection problem when scanning for threats.
Is there any way that i can open a text file…
I believe I've read all the relevant Process.Start impersonation questions - at least all I could find via Google, but I haven't found one that matches this situation (and 90% are re: ASP which is a whole different ballgame)
Scenario: We've got a…
I have a WinForms application that accepts a command line argument by calling Environment.GetCommandLineArgs() and does something with it.
It works fine in Debug mode - I enter the argument in the Debug tab of Project Properties, then run it (F5)…
I have an asp.net application which uses process.start to call an executable (Graphviz). All works well in my development environment, but when I move to production I'm not able to get the process to run. Here's the details.
I created this simple…
I am trying to use the Windows Process.start service in Visual Studios 2005 to call Windows task scheduler (schtasks) which calls the bat file. The process works fine except that the bat file takes in parameters but it won't work when I am trying to…
I'm trying to launch an external instance of Chrome from a c# Windows form. It works fine as long as there are no spaces in the path of the local html file. If there are though Chrome stops at the first space.
e.g. :…