I'm looking for a way to figure out the command-line arguments of any Windows service.
For a non-service process, the command-line arguments can be found in the Windows Task Manager, or programmatically by using WMI as shown in this post.
Unfortunately, these two solutions don't work for a Windows service that is started by the ServiceController.Start(String[] args) method. Both of them show only the executable file path on the command-line, even though some arguments were passed in.
Я также пробовал создать простую службу, которая просто записывает все аргументы командной строки в журнал событий. Я запустил его с помощью «sc.exe start
и убедился, что
не был записан в журнал событий.
Однако ни один из решения сработали для меня. Я пока видел только путь к исполняемому файлу. Моя версия ОС - Windows Server 2008 R2 SP1 x64 Enterprise.