0

I am trying to run the batch file from process in c#. It is not running. But when I trigger the same batch file manually in admin mode, it is working fine. I am running the application in Administrator mode. How to make the particular process also to run in admin mode.

Balagurunathan Marimuthu
  • 2,927
  • 4
  • 31
  • 44
  • There are a lot of examples available over internet on how to execute a process as admin. Try this link as head start: https://stackoverflow.com/questions/2532769/how-to-start-a-process-as-administrator-mode-in-c-sharp – praty Oct 12 '17 at 06:50
  • A batch file when run from a cmd.exe will use the environmental variable PATH to locate files and executables. When run from a VS application you do not have the same environment so make sure any file references contain the full pathname. – jdweng Oct 12 '17 at 06:51
  • what does the batch file do? Say it tries to access folders. Does it have permission to do so? Instead of running batch as admin give batch access to whatever it needs to have acees to – user3532232 Oct 12 '17 at 07:04
  • Actually I`m running AWSCLI script in batch file to download the files from AWS to local. When I`m trying to run this batch manually with admin mode, it is downloading the files as expected to local but when I`m calling the same batch file through c# process, it is not working. – VenkY VictorY Oct 12 '17 at 09:25
  • Issue fixed! File access right issue.After providing access rights to the file , able to perform operations using batch file. – VenkY VictorY Sep 11 '18 at 18:34

0 Answers0