• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

java.lang.Runtime close cmd window

 
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
 
Master Rancher
Posts: 4663
49
  • 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
 
Marshal
Posts: 3181
466
Android Eclipse IDE TypeScript Redhat MicroProfile Quarkus Java Linux
  • 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
Marshal
Posts: 3181
466
Android Eclipse IDE TypeScript Redhat MicroProfile Quarkus Java Linux
  • 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.
 
Master Rancher
Posts: 3921
36
  • Likes 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is in aion.bat?
 
Ron McLeod
Marshal
Posts: 3181
466
Android Eclipse IDE TypeScript Redhat MicroProfile Quarkus Java Linux
  • 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
Marshal
Posts: 3181
466
Android Eclipse IDE TypeScript Redhat MicroProfile Quarkus Java Linux
  • 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.
 
We cannot change unless we survive, but we will not survive unless we change. Evolving tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic