Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#3.0 C#4.0
Hi Guys,
 
I have the following scenario:
 
I have a directory name : Management Server
 
I need to find out through code where this directory is whether it is in Program Files or Program Files (x86) or on another drive on the computer
 
Is there a way to do this?
 
Thanks in advance!
Posted 13-Jun-12 0:20am
Edited 13-Jun-12 0:44am
v2
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Hi,
 
why dont you use
string[] l_dir = Directory.GetDirectories API to search out the reqd directory.
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

Do you know the program which created that directory? If not, you could follow the "Solution" described by nitin-aem which might take a very long time to execute...
But if you know it, find out
(1) that that program is installed (otherwise that folder won't exist)
(2) how that program stores its settings (some ini files, xml files, registry keys etc...) and read it from their settings
With a newer version of that program, things may change...
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 359
1 Nirav Prabtani 273
2 OriginalGriff 229
3 _Amy 165
4 Maciej Los 145
0 OriginalGriff 7,744
1 Sergey Alexandrovich Kryukov 6,956
2 Maciej Los 3,994
3 Peter Leow 3,708
4 CHill60 2,742


Advertise | Privacy | Mobile
Web03 | 2.8.140721.1 | Last Updated 13 Jun 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100