CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Mar 2010
    Posts
    3

    Need help on Windows Batch Programming

    Hi code gurus,

    I've a little bit problem in batch script... I would appreciate if anyone of gurus here able to help.

    Here is the code

    C:\>type ie.bat
    Code:
    @ECHO OFF
    C:\Program.exe
    EXIT
    Everytime I launch the batch file, the cmd windows is still there. I just want to run the program and close the cmd windows. I've tried to put EXIT at the end of the code, but it doesn't change anything.

    Thanks code gurus in advance.

  2. #2
    Join Date
    Dec 2009
    Posts
    596

    Re: Need help on Windows Batch Programming

    Here's a link that talks about a similar situation you are having. If you're running XP then this might point you in the right direction.


    http://www.computing.net/answers/win...dow/98455.html

  3. #3
    Join Date
    Mar 2004
    Location
    Prague, Czech Republic, EU
    Posts
    1,701

    Re: Need help on Windows Batch Programming

    Launch the program with start internal command
    Code:
    @ECHO OFF
    start C:\Program.exe
    EXIT
    • Make it run.
    • Make it right.
    • Make it fast.

    Don't hesitate to rate my post.

  4. #4
    Join Date
    Mar 2010
    Posts
    3

    Re: Need help on Windows Batch Programming

    Quote Originally Posted by viperbyte View Post
    Here's a link that talks about a similar situation you are having. If you're running XP then this might point you in the right direction.

    http://www.computing.net/answers/win...> /98455.html
    Jump,
    You have to rename your .bat file with the .cmd extension. The old .bat does not work in XP. So,, if your file was named SONY.BAT, then rename it to SONY.CMD and it will work fine...)

    Safe Computing...)
    Thanks viperbyte for your help. I've renamed script.bat to script.cmd. I still can launch the program but the command prompt still open.

  5. #5
    Join Date
    Mar 2010
    Posts
    3

    Talking Re: Need help on Windows Batch Programming

    Quote Originally Posted by boudino View Post
    Launch the program with start internal command
    Code:
    @ECHO OFF
    start C:\Program.exe
    EXIT
    Thanks boudino! It works

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured