![]() |
| | #1 |
| Registered User Join Date: Jun 2009
Posts: 6
| List all system and program files I'm trying to get list of all system and program files in my computer (WinXP Pro). With system files, I found a solution at (System Files Reference). Now I'm finding a way to list all program files in my computer. Actually, I did a lot of search but it seems that ... Below are some solutions for this (but they're not good enough): Soution 1: Read InstallLocation from "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Cur rentVersion\Uninstall". But I found out that some Product don't have value InstallLocation, because it didn't set when installing. Solution 2: msiexec have some options to uninstall a software, it make me think about some msi functions (Installer Function Reference (Windows)). I found out that we have 2 useful functions to get all installed products and product's information (MsiEnumProductsEx, MsiGetProductInfoEx). But after read carefully about MsiGetProductInfoEx functions, there is no way to guarantee that I can get InstallLocation property for all products. At this time, it seems that I'm chasing my tail. Anyone face this before??? Any help or comments are appreciated. Thanks in advance, Tu PS: sorry for bad English |
| tnbui is offline | |
| | #2 |
| Registered User Join Date: Apr 2007
Posts: 127
| For "Add/Remove Programs" list, it's done with COM... |
| Alex31 is offline | |
| | #3 |
| Registered User Join Date: Jun 2009
Posts: 6
| Hi Alex, Can you explain more about this? As I know, the way "Add & Remove Programs" do is just get "DisplayName" value from key "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows \Cur rentVersion\Uninstall". For more reference about this : The Old New Thing : How does Add/Remove Programs get the size and other information? Thanks for your reply, TU |
| tnbui is offline | |
| | #4 |
| Guest Join Date: Aug 2001
Posts: 4,922
| There is really no way to do this and be 100% thorough about it. Programs can create whatever registry keys they wish, and many programs don't even touch the registry at all! So, yeah, you're basically chasing your tail with this one. |
| Sebastiani is offline | |
| | #5 |
| train spotter Join Date: Aug 2001 Location: near a computer
Posts: 3,359
| If I wanted to find all programs (.exe, .com and .bat) and all system files in a folder I would use FindFirstFile() (etc). Programs are found using a filter (ie "C:\\*.exe"). System files are flagged in the returned WIN32_FIND_DATA dwFileAttibutes as FILE_ATTRIBUTE_SYSTEM If WIN32_FIND_DATA dwFileAttibutes also tells you if the 'file' is a folder (watch out for the folders "." and "..") I use a recusive find method. Your whole PC could be a big target however....
__________________ "Man alone suffers so excruciatingly in the world that he was compelled to invent laughter." Friedrich Nietzsche "I spent a lot of my money on booze, birds and fast cars......the rest I squandered." George Best "If you are going through hell....keep going." Winston Churchill |
| novacain is offline | |
| | #6 | |
| Registered User Join Date: Jun 2009
Posts: 6
| Hi novacain, Quote:
Btw, thks for your response. -Tu | |
| tnbui is offline | |
| | #7 |
| train spotter Join Date: Aug 2001 Location: near a computer
Posts: 3,359
| The files you list are types used by programs (but can not be 'run' on their own). ie .pdf is 'portable document format' IIRC and requires Adobe Acrobat to open. Try renaming AcroRd32.exe (or similar for your version of Acrobat) and open a .pdf file.
__________________ "Man alone suffers so excruciatingly in the world that he was compelled to invent laughter." Friedrich Nietzsche "I spent a lot of my money on booze, birds and fast cars......the rest I squandered." George Best "If you are going through hell....keep going." Winston Churchill |
| novacain is offline | |
| | #8 |
| Registered User Join Date: Jun 2009
Posts: 6
| I think you misunderstood my idea. Btw, I found a way to work around my problem. An installed application usually create an msi database and store in C:\WINDOWS\Installer. So that I'll read these databases to get my information. With some applications that don't touch registry, I agree with you Sebastiani, there is no way to get information from them. -Tu |
| tnbui is offline | |
![]() |
| Thread Tools | |
| Display Modes | |
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Client-server system with input from separate program | robot-ic | Networking/Device Communication | 3 | 01-16-2009 03:30 PM |
| Program Deployment and DLL/OCX Files? | dfghjk | C++ Programming | 5 | 06-16-2008 02:47 AM |
| Need to write a program to execute a list of system commands | mdthahir | C Programming | 2 | 07-27-2007 12:48 PM |
| Using variables in system() | Afro | C Programming | 8 | 07-03-2007 12:27 PM |
| fopen(); | GanglyLamb | C Programming | 8 | 11-03-2002 12:39 PM |