CSIDL_PROGRAM_FILES always returns x86

renderman47

New member
Local time
2:43 PM
Messages
5
I am not sure if this is the right forum to discuss this.
I have a code that needs to search for an exe. By default the application saves in the program files folder and hence I use

Code:
SHGetFolderPath(NULL, 
                             CSIDL_PROGRAM_FILES, 
                             NULL, 
                             0, 
                             szPath
to search for the folder. This is returning the Program Files(x86) all the time, even if the application is stored in Program files. I am using Win 7 64bit and the code is being compiled for x64. Does anybody know why this might be happening ? Also, what is the best method to search for an exe when its not launched thru code ?

Thanks
 

My Computer

OS
Windows 7 64bit
Hi, Welcome to SF,

I'm not sure about this but see whether this helps CSIDL

Hope ths helps,
Captain
 

My Computer

Computer Manufacturer/Model Number
Samsung NP550P5C-S02IN
OS
Windows 7 Ultimate - 64-bit | Windows 8 Pro - 64-bit
CPU
Intel® Core™ i7 Processor 3,610QM (2.30Hz, 6MB L3 Cach
Memory
8 GB
Graphics Card(s)
NVIDIA® GeForce® GT 650M 2GB Graphics, Optimus™ techno
Sound Card
SoundAlive™ JBL 3 Speakers (With sub-Woofer)
Monitor(s) Displays
39.62cm (15.6) SuperBright 300nit HD+ LED Display
Screen Resolution
1,600 x 900, Anti-Reflective
Hard Drives
1TB S-ATA II Hard Drive (5,400RPM)
Yes, that is what i had referred. Can you please test and tell me if it is just me that are getting the wrong folder name ?
 

My Computer

OS
Windows 7 64bit
Back
Top