• Post Reply Bookmark Topic Watch Topic
  • New Topic

java.lang.Runtime close cmd window  RSS feed

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want the cmd.exe window to close after this line:



Because now window remains open after it executes the command in cmd.

I could run this as alternative but there must be another way



Kind regards, Jimme
 
Ranch Foreman
Posts: 3068
37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Don't you want /c instead of /k?
Not that I'm an expert, but I though that was the one to stop the cmd window after the work is complete.
 
jimme van der meer
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ye I tried that but didnt work
 
Bartender
Posts: 1603
232
Android Angular Framework Eclipse IDE Java Linux MySQL Database Redhat TypeScript
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
jimme van der meer wrote:Ye I tried that but didnt work

Does that mean the file manager opened and the cmd window remained?



As Dave mentioned, definitely not /K - that will cause the window to remain open.

>help cmd
Starts a new instance of the Windows command interpreter

CMD [/A | /U] [/Q] [/D] [/E:ON | /E:OFF] [/F:ON | /F:OFF] [/V:ON | /V:OFF]
    [[/S] [/C | /K] string]

/C      Carries out the command specified by string and then terminates
/K      Carries out the command specified by string but remains
...
 
Ron McLeod
Bartender
Posts: 1603
232
Android Angular Framework Eclipse IDE Java Linux MySQL Database Redhat TypeScript
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
jimme van der meer wrote:Ye I tried that but didnt work


I just ran this (Windows 10, Java 8) and a file manager window opened - no cmd window.
 
Rancher
Posts: 2240
28
  • Likes 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is in aion.bat?
 
Ron McLeod
Bartender
Posts: 1603
232
Android Angular Framework Eclipse IDE Java Linux MySQL Database Redhat TypeScript
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Norm Radder wrote:What is in aion.bat?

Whoops - missed that.  I only use start to bring up the file manager from the command line - didn't notice that he is actually starting a batch file.
 
Ron McLeod
Bartender
Posts: 1603
232
Android Angular Framework Eclipse IDE Java Linux MySQL Database Redhat TypeScript
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The /b option with start should run the batch file without creating a cmd window - try that.

    cmd /c start /b C:\\aion.bat
 
jimme van der meer
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ron McLeod wrote:
jimme van der meer wrote:Ye I tried that but didnt work


I just ran this (Windows 10, Java 8) and a file manager window opened - no cmd window.


Yes thanks, that works for me aswell, but when I run the bat file it somehow remains open.

The bat file contains:

start "" "C:\Program Files (x86)\GameforgeLive\Games\GBR_eng\AION\Download\bin32\aion.bin" -ip:79.110.83.80 -port:2106 -cc:2 -noauthgg -ls -charnamemenu -lang:enu

What it does is, it runs the game by the given file locations of the 32bit bin file.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!