How can I run an exe file with C # code? So I have this:
Process.Start( @"C:\Program Files (x86)\Photoshop\Photoshop.exe");
But the path may be different in other machines. So, are there any ideas for running .exe with another way?
Thanks!
I have found a solution.
Activator.CreateInstance(Type.GetTypeFromProgID("Photoshop.Application"));
No, you cannot run an exe file without knowing its location.
An โexceptionโ is if the executable directory is in the PATH environment variable, therefore:
Process.Start("notepad.exe");
work.
If I understand you correctly, the executable is within your reach, so just put it in the project directory and do not specify any path (by default, this is a relative path):
Process.Start("Photoshop.exe");
Source: https://habr.com/ru/post/1260558/More articles:How to request Dynamics CRM web API using custom FetchXml using quantity value filter? - dynamics-crmElixir-pry session terminates because database connection time has ended - debuggingUnable to use yellow color with Android notification notification Nougat - androidquiet service interface with knitwear - jacksonWhy does using toString () in a float give different results in Firefox vs. Chrome vs. IE? - javascript401 when authenticating through a service account and OAuth2 on GoogleDrive - google-drive-sdkTwo vertical blocks with dynamic content - cssgoogle oauth2 impersonates a service account using user@gmail.com - javahttps://translate.googleusercontent.com/translate_c?depth=1&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1260562/google-drive-api-services-account-view-uploaded-files-to-google-drive-using-java&usg=ALkJrhgG-TvUF9Epw5RigVIfSbWFJO7ezgPrinting a pyramid of symbols - javaAll Articles