By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,659 Members | 1,945 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,659 IT Pros & Developers. It's quick & easy.

Windows utility to get the full command line path for a process

P: 2
Hi All,

I need a windows utility which can get me the command line path for a process. Say I have an application which has a java.exe process running, it should return me the install directory for the same. I need to execute that utility from a javascript.

Any help is much appreciated!
Jun 12 '07 #1
Share this Question
Share on Google+
3 Replies


bartonc
Expert 5K+
P: 6,596
Hi All,

I need a windows utility which can get me the command line path for a process. Say I have an application which has a java.exe process running, it should return me the install directory for the same. I need to execute that utility from a javascript.

Any help is much appreciated!
You'll want to get Process Explorer. There are a couple of other cool tools there, as well.
Jun 12 '07 #2

bartonc
Expert 5K+
P: 6,596
You'll want to get Process Explorer. There are a couple of other cool tools there, as well.
Sorry. I only read the first half of your post. Since Sysinternals can do it, there must be a way to query to OS for this info. I'll check around a bit to see what I can find.
Jun 12 '07 #3

Expert 100+
P: 511
Hi All,

I need a windows utility which can get me the command line path for a process. Say I have an application which has a java.exe process running, it should return me the install directory for the same. I need to execute that utility from a javascript.

Any help is much appreciated!
here's a vbscript snippet
Expand|Select|Wrap|Line Numbers
  1.  
  2. Set Processes = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2").ExecQuery("select * from Win32_Process where Name='SMSS.exe'")
  3. For each Process in Processes
  4.    PList = PList & Process.CommandLine & vbLf
  5. Next
  6. WScript.Echo "command line: " & VBlf & VBlf & UCase(PList)
  7.  
Jun 12 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.