Results 1 to 4 of 4

Thread: Re: จะสั่งให้ run โปรแกรม .exe ทำไง

  1. #1
    man_sss
    Guest


    จะสั่งให้ run โปรแกรม .exe ทำไง

    อยากจะเขียน java ให้สั่ง รันโปรแกรม.exe ไม่รู้ว่าเขียนยังไง ผมควรศึกษาเรื่องอะไรบ้าง ช่วยหน่อยเถอะครับ ขอบคุณมากครับ

  2. #2
    Administrator asylu3's Avatar
    Join Date
    Jun 2000
    Location
    Thailand
    Posts
    3,557


    Re: จะสั่งให้ run โปรแกรม .exe ทำไง

    ลองพิจารณา Code นี้ดูนะครับ

    [src]import java.io.*;
    public class CmdExec {
    public CmdExec(String cmdline) {
    try {
    String line;
    Process p = Runtime.getRuntime().exec(cmdline);
    BufferedReader input =
    new BufferedReader
    (new InputStreamReader(p.getInputStream()));
    while ((line = input.readLine()) != null) {
    System.out.println(line);
    }
    input.close();
    }
    catch (Exception err) {
    err.printStackTrace();
    }
    }

    public static void main(String argv[]) {
    new CmdExec("myprog.bat");
    }
    }


    [myprog.bat]
    echo hello world!


    [/src]

  3. #3
    man_sss
    Guest


    Re: จะสั่งให้ run โปรแกรม .exe ทำไง

    แล้วให้แสดง windows ของ Dos ขึ้นมาใช้งานล่ะครับ

  4. #4
    Administrator asylu3's Avatar
    Join Date
    Jun 2000
    Location
    Thailand
    Posts
    3,557


    Re: จะสั่งให้ run โปรแกรม .exe ทำไง

    ปกติใน run menu เราจะพิมพ์ว่า "cmd"
    ในกรณีนี้ผมว่าคล้ายกันนะครับ
    คือให้แทรก คำสั่ง cmd ไว้ใน file .bat

Similar Threads

  1. fullmember ทำไง
    By card5555 in forum แจ้งปัญหาการใช้งานบอร์ด
    Replies: 12
    Last Post: 08-01-2010, 09:56 PM
  2. ถาม : อยากรู้วิธีการทำ Rollver Image แบบ phpbb ครับ ทำไง
    By winmax in forum บทความ คอมพิวเตอร์ ทัวไป
    Replies: 3
    Last Post: 17-04-2008, 05:15 PM
  3. ทำไง หากสั่ง Uninstall ไปแล้ว แต่รายชื่อโปรแกรมยังอยู่
    By pangbarbie in forum ทิปหรือเคล็ดลับการคอมพิวเตอร์ต่างๆ
    Replies: 0
    Last Post: 23-02-2008, 06:52 PM
  4. อยากได้ ทำไง
    By Anonymous in forum E-Book, Video หรือบทความทั่วไปด้าน Computer
    Replies: 1
    Last Post: 25-01-2005, 01:04 PM
  5. Replies: 1
    Last Post: 03-12-2004, 11:07 AM

Members who have read this thread : 0

Actions : (View-Readers)

There are no names to display.

Members who have read this thread: 0

There are no members to list at the moment.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •