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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T16:12:28+00:00 2026-06-08T16:12:28+00:00

The following line works fine from my java application on Windows XP: Process p

  • 0

The following line works fine from my java application on Windows XP:

Process p = Runtime.getRuntime().exec("msg.exe * this is a test");  

When it executes on Windows 7 (64-bit), I get the following error:

Cannot run program “msg.exe”: CreateProcess error=2, The system cannot find the file specified

I have tried putting in the full path to the .exe, and I get the same error:

Process p = Runtime.getRuntime().exec("c:\\Windows\\System32\\msg.exe * this is a test");

Using ProcessBuilder instead of Runtime gives the same error:

Process p = new ProcessBuilder("msg.exe * this is a test").start();

I tried to rule out a permissions issue by temporarily giving everyone full control to msg.exe but Windows would not let me – the options were greyed out even when I logged in as administrator.

So I confirmed that the user of the java process has read and execute permissions to msg.exe.

I am able to successfully run the command (as the same user of the java process) from the command line of the Windows 7 machine.

In the notes of this post: C# cannot find file specified, someone alludes to a similar issue with a Windows 64-bit machine not finding msg.exe from a C# program, so perhaps there is something on the Windows configuration side that I need to do?

Is there a way to get a java application to send a network message on Windows 7? Or some alternative for sending a network message that will work?

  • 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-08T16:12:30+00:00Added an answer on June 8, 2026 at 4:12 pm

    You may have a 32-bit Java installation, which wouldn’t be allowed to start 64-bit programs on Windows 7. If you have 32-bit Java installed, upgrade to 64-bit Java and then try again.

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

Sidebar

Related Questions

The following code works fine when running from java command line. However when running
I have the following line of code which works fine locally, but breaks when
I have the following code that works fine up to the last line in
I'm trying to run a clang compile from a Java application. It works great
I have Buildr installed on Ubuntu and it works fine running from command line.
My program has the following lines, works fine when run from Netbeans, JButton Button_1=new
I am following this tutorial to build my first Java 3D application. I included
I'm getting the following, yet log4j works fine in the java files of a
I am using this simple code to connect with Twitter. First line works fine
I thought the following line of code should work fine: $(.1).attr('href', '#Home'); Right? But

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.