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 8127657
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T07:36:35+00:00 2026-06-06T07:36:35+00:00

I have been trying to read as much on stackoverflow about this as possible,

  • 0

I have been trying to read as much on stackoverflow about this as possible, but I need to open an outlook offline template (.oft) file. Then have a file attached to it. I will put the command into a java application.

I would use a command line switch, but it creates a new message with the attachment and opens the oft file, it’s not attaching it to the .oft.

"C:\Program Files (x86)\Microsoft Office\Office14\Outlook.exe" /f "C:\RSASoftToken\android.msg" /a "C:\RSASoftToken\android\WMH7.sdtid"

If there is a way to get command line to work, that would be the easiest. If not what else can I do in java?

I need to add it to this code

    //the New File Name
    String newFileName = Prefix + fileName.substring(0,4) + Suffix + fileExtension;
    String tentativeName = "new Filename will be ->"+newFileName+"\n";
    System.out.println(tentativeName);
    if(cbxAndroid.isSelected() == true ){
        try {   Runtime rt = Runtime.getRuntime();                               
                Process pr = rt.exec("cmd /c \\RSASoftToken\\TokenConverter.exe \\RSASoftToken\\android\\"+newFileName+" -android -o \\RSASoftToken\\android\\"+newFileName.substring(0,4)+".txt");
                BufferedReader input = new BufferedReader(new InputStreamReader(pr.getInputStream()));                  
                String line=null;                 
        while((line=input.readLine()) != null) {                     
            System.out.println(line);                 }                  
        int exitVal = pr.waitFor();                 
        System.out.println("Exited with error code "+exitVal);              
        } catch(Exception e) {                 
            System.out.println(e.toString());                 
            e.printStackTrace();             
            }         

        }
  • 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-06-06T07:36:36+00:00Added an answer on June 6, 2026 at 7:36 am

    Here’s how you would execute that command from Java:

        Process p = Runtime.getRuntime().exec(new String[]{
            "C:\Program Files (x86)\Microsoft Office\Office14\Outlook.exe",
            "/f",
            "C:\mail\android.oft",
            "/a",
            "C:\android\file.txt");
    

    You can then call the getXxxStream() methods on the Process object to get streams for writing to the external processes standard input and reading from its standard output and standard error.

    However, I don’t understand what you are really trying to do here, or whether running this command will allow you to achieve it.

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

Sidebar

Related Questions

I've been trying for hours and have read what this site and the internet
I have been trying to read up on GCD and trying to figure it
I have been trying to read a node from YouTube respons. If ever delt
Im having a small problem with my code. I have been trying to read
I have been trying to figure out how to read paragraph content which exists
i have been trying to write a program in python to read two text
I have been trying to write some code in Scala to read a file
I've been trying to read more about what to do properly catching / handling
I know that there have been plenty of topics describing this topic but I
hey the title pretty much says it all. i have been trying different methods

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.