How do I get the commandline that started the process

后端 未结 8 1390
小鲜肉
小鲜肉 2020-11-30 10:25

From Java, is it possible to get the complete commandline with all arguments that started the application?

System.getEnv() and System.getPropertie

8条回答
  •  时光取名叫无心
    2020-11-30 10:50

    The following links may help you get there:

    How to get command line arguments for a running process

    get command-line of running processes

    How to get a list of current open windows/process with Java?

    Just as a note:

    In Windows you have Process Explorer by Sysinternals that shows you the command line used to open the process. Right click the process and select Properties... You'll see Command Line in the window that is opened.

提交回复
热议问题