Path of running application.
-
Hi, i need path of all running application. if we have two ms-word doc file, so how i can find path of this two file. i find path of notepad using ManagementClass MgmtClass = new ManagementClass("Win32_Process"); and CommandLine property. it gives only path of notepad allpication only, but not work in the case of word,xls file. plz help me
-
Hi, i need path of all running application. if we have two ms-word doc file, so how i can find path of this two file. i find path of notepad using ManagementClass MgmtClass = new ManagementClass("Win32_Process"); and CommandLine property. it gives only path of notepad allpication only, but not work in the case of word,xls file. plz help me
Im not sure you will be able to, after a program loads a file, it's usually stored in memory until the user saves it. Each application will probably have some variable somewhere which stores the location of the file (so when you click save it knows where to stick the data) but i don't think you'll be able to access it.
My current favourite word is: Bacon!
-SK Genius
-
Hi, i need path of all running application. if we have two ms-word doc file, so how i can find path of this two file. i find path of notepad using ManagementClass MgmtClass = new ManagementClass("Win32_Process"); and CommandLine property. it gives only path of notepad allpication only, but not work in the case of word,xls file. plz help me
Could you clarify the question, I don't really understand what you are trying to do. System.Environment.CurrentDirectory and System.Reflection.Runtime.Process would both be worth a look though I think.
-
Could you clarify the question, I don't really understand what you are trying to do. System.Environment.CurrentDirectory and System.Reflection.Runtime.Process would both be worth a look though I think.
hi Derek, Thanks for your quick reply. i need physical location and size of all application, which is running. have you seen task manager control panel.whatever the application running under applications tab.i need physical location and size of all application. thanks in anticipation. balram mallick
-
hi Derek, Thanks for your quick reply. i need physical location and size of all application, which is running. have you seen task manager control panel.whatever the application running under applications tab.i need physical location and size of all application. thanks in anticipation. balram mallick
foreach (Process p in System.Diagnostics.Process.GetProcesses()) {
Member 4044988 wrote:
physical location
System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName
Member 4044988 wrote:
size of application
FileInfo class will give you that once you have the FileName }
-
foreach (Process p in System.Diagnostics.Process.GetProcesses()) {
Member 4044988 wrote:
physical location
System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName
Member 4044988 wrote:
size of application
FileInfo class will give you that once you have the FileName }
Hi Derek, System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName gives the path of main module. means if you have opened ms -word doc "abc.doc" ,then the code which you have provided will give the path pf winword.exe. it will not give the path of "abc.doc". i need path of "abc.doc", not the path of winword.exe. now as i think requirement is clear to you. once again thanks for your reply. Balram mallick
-
Hi Derek, System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName gives the path of main module. means if you have opened ms -word doc "abc.doc" ,then the code which you have provided will give the path pf winword.exe. it will not give the path of "abc.doc". i need path of "abc.doc", not the path of winword.exe. now as i think requirement is clear to you. once again thanks for your reply. Balram mallick
That's VERY difficult. I'll have a think, however I seriously doubt i'll be able to do that. Do you need the path of the open file for all applications (e.g. internet explorer, notepad, etc., or just word)
-
That's VERY difficult. I'll have a think, however I seriously doubt i'll be able to do that. Do you need the path of the open file for all applications (e.g. internet explorer, notepad, etc., or just word)
yes, now you are getting the point.if you will able to help me that will be really appreciable.Thanks for your co-operation. balram
-
yes, now you are getting the point.if you will able to help me that will be really appreciable.Thanks for your co-operation. balram
I don't know how you'd do it for all applications, however for office applications there is a specific programming api. Have a look in there. The only other piece of information I can suggest is watching disk activity; there are certainly applications out there that show which processes are accessing which files. That's the best I can do i'm afraid, sorry and good luck, Derek Bartram.
-
I don't know how you'd do it for all applications, however for office applications there is a specific programming api. Have a look in there. The only other piece of information I can suggest is watching disk activity; there are certainly applications out there that show which processes are accessing which files. That's the best I can do i'm afraid, sorry and good luck, Derek Bartram.
hi derek do you have any idea that how i can get path of office applications. i am not getting the api which can show the path of office application.
-
hi derek do you have any idea that how i can get path of office applications. i am not getting the api which can show the path of office application.
Member 4044988 wrote:
do you have any idea that how i can get path of office applications.
None at all, sorry.
Member 4044988 wrote:
i am not getting the api which can show the path of office application.
http://www.microsoft.com/downloads/details.aspx?FamilyId=135F4D99-F480-4A81-AF8F-F6E4896611E2[^], I'm refering to this (and obviously the 2007 version as well).