Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4107990
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T21:35:26+00:00 2026-05-20T21:35:26+00:00

I have implemeneted a method into my c# program to run a batch file,

  • 0

I have implemeneted a method into my c# program to run a batch file, which runs a virus scan on any files uploaded;

public static Int32 ExecuteCommand(String filePath, Int32 Timeout){
    Int32 ExitCode;
    ProcessStartInfo ProcessInfo = new ProcessStartInfo();
    ProcessInfo.CreateNoWindow = true;
    ProcessInfo.UseShellExecute = true;
    ProcessInfo.FileName = filePath;
    Process proc = Process.Start(ProcessInfo);
    proc.WaitForExit(Timeout);
    ExitCode = proc.ExitCode;
    proc.Close();
    return ExitCode;
 }

Ok now my batch file;

@ECHO OFF
c:
cd "..\AVG\AVG9\"
avgscana.exe /SCAN="..\learninglounge.com.solar.quarantine\" /REPORT="..\learninglounge.com.solar.antivirus\virusReports\report.txt"

EDIT : I do have fully qualified link to avg exe and directories but have replaced here with .. for purposes of posting to stackoverflow. Sorry if this caused confusion.

So my problem is the reporting side of my batch file. I can double click the batch file and it scans and creates the report no problem. When i run it through my c# i get an exit code of 2; command not recognised. It’s fine if i remove the report part of my batch file. Now obviously this points to write permissions but I have checked that and the impersonated user has write access on the directory. Is there anything Im missing?

Thanks all

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T21:35:27+00:00Added an answer on May 20, 2026 at 9:35 pm

    Ok well ive done a work around, id rather have saved the report there and then but instead i just catch the standard output from the process and then save to a file + any processing.

    Weird one this.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My program doesnt even go into the scrollViewDidScroll method. I have no idea why.
I have implemented a test method with Jersey to run on my Google AppEngine
I have a ViewController (with a MKMapView) which is pushed into, because of the
I'm making a program that allows you to add any class file that extends
I have a program in which I want to be able to store certain
I have implemented a custom TraceListener which both logs the messages sent to method
So, I have implemented this method to add a footer to my table view:
I have implemented the search method for a UITableView populate from a NSArray (mylist):
I have made a custom NSView and have implemented the keyDown: method. However, when
I am trying to learn LINQ to SQL. I have successfully implemented insert method

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.