How can I start another application from within C# code? I can't get this piece to work correctly
System.Diagnostics.Process.Start(@"%userprofile%\AppData\Local\Google\Application\chrome.exe");
Edit: Wow I was dumb and just noticed what I forgot in the filepath. Thanks for the answers though they helped teach me some other useful things.
In Linux system apart of system() function call, you can use following exec() library functions to execute new program.
As I know, any address in a program only belongs itself, meaning that you can't invoke a function of another program thought its address. Data is code, code is data. As soon as your exploit payload (i.e. machine code) is read into memory by the process you're attacking, it has an address in the target process.
When a program calls another program file, the called program must have the RETURN command at the end. False 57.
I don't think Process.Start
expands environment variables for you. Try this:
var path = Environment.ExpandEnvironmentVariables(@"%userprofile%\AppData\Local\Google\Application\chrome.exe");
Process.Start(path);
try this link for starting external program Also try this Similar Question on stackoverFlow
this is an example here
string winpath = Environment.GetEnvironmentVariable("windir");
string path = System.IO.Path.GetDirectoryName(
System.Windows.Forms.Application.ExecutablePath);
Process.Start(winpath + @"\Microsoft.NET\Framework\v1.0.3705\Installutil.exe",
path + "\\MyService.exe");
And in your case ,write the following on top where all the using namespaces are listed
using System.Diagnostics;
using System;
so then in your code directly write the above code...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With