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

  • SEARCH
  • Home
  • 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 3353962
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T02:12:53+00:00 2026-05-18T02:12:53+00:00

I would like to ask a few questions: •How to execute the command C:\strawberry\perl\bin\perl.exe

  • 0

I would like to ask a few questions:

•How to execute the command “C:\strawberry\perl\bin\perl.exe C:\temp\bin\mactime.pl -b C:\temp\bin\testing.bodyfile -z UCT-8 > C:\temp\bin\testing2.txt” in a C# console program?

•How do I display the results of the console? Should I use “console.writeline”?

The mactime.pl is from “The Sleuth Kit” windows.

The command works perfectly on the normal command prompt. The C# console program executes with errors of:

“Can’t open C:\temp\bin\testing.bodyfile -z UCT-8 >C:\temp\bin\testing2.txt at C:\temp\bin\mactime.pl line 282.”

and does not disply any results. There is no “testing2.txt” being generated after the program was executed.

The following are my codes:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Win32;
using System.Diagnostics;

namespace ConsoleApplication1
{
class Program
{
   static void Main(string[] args)
   {
       LaunchCommandLineApp(); 
   }   

   static void LaunchCommandLineApp()
{
    // For the example
    const string ex1 = "C:\\temp\\bin\\mactime.pl";
    const string ex2 = "C:\\temp\\bin\\testing.bodyfile";
    const string ex3 = "C:\\temp\\bin\\testing2.txt";

    // Use ProcessStartInfo class
    ProcessStartInfo startInfo = new ProcessStartInfo();
    startInfo.CreateNoWindow = false;
    startInfo.UseShellExecute = false;
    startInfo.FileName = "C:\\strawberry\\perl\\bin\\perl.exe";
    startInfo.WindowStyle = ProcessWindowStyle.Hidden;
    startInfo.Arguments = "\"" + ex1 + "\" -b " + ex2 + "\" -z UCT-8 >" + ex3;

    try
    {
        // Start the process with the info we specified.
        // Call WaitForExit and then the using statement will close.
        using (Process exeProcess  = Process.Start(startInfo))
        {
            exeProcess.WaitForExit();
        }
    }
    catch
    {
        // Log error.
    }
  }
  }
  }

Mactime.pl Arguments:

mactime [-b body_file] [-p password_file] [-g group_file] [-i day|hour idx_file]
[-d] [-h] [-V] [-y] [-z TIME_ZONE] [DATE]
-b: Specifies the body file location, else STDIN is used
-d: Output timeline and index file in comma delimited format
-h: Display a header with session information
-i [day | hour] file: Specifies the index file with a summary of results

    -g: Specifies the group file location, else GIDs are used
    -p: Specifies the password file location, else UIDs are used
    -V: Prints the version to STDOUT
    -y: Dates have year first (yyyy/mm/dd) instead of (mm/dd/yyyy)
    -m: Dates have month as number instead of word (can be used with -y)
    -z: Specify the timezone the data came from (in the local system format)

    [DATE]: starting date (yyyy-mm-dd) or range (yyyy-mm-dd..yyyy-mm-dd)
  • 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-18T02:12:54+00:00Added an answer on May 18, 2026 at 2:12 am

    Fix the arguments. On your code it currently looks like:

    “C:\temp\bin\mactime.pl” -b C:\temp\bin\testing.bodyfile” -z UCT-8 >C:\temp\bin\testing2.txt

    Notice the unmatched " and there’s no space after >.
    Change that into:

    startInfo.Arguments = "\"" + ex1 + "\" -b \"" + ex2 + "\" -z UCT-8 > \"" + ex3 + "\"";
    

    Its now like:

    “C:\temp\bin\mactime.pl” -b “C:\temp\bin\testing.bodyfile” -z UCT-8 > “C:\temp\bin\testing2.txt”

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

Sidebar

Related Questions

No related questions found

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.