473,382 Members | 1,717 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

getting name of a file extension from explorer

How do you go about getting the "type" of a file from explorer? Say if I
want to know what the type for the extension .DOC was, which is "Micrsoft
Word Document" in explorer, how would I do this? I just want to get the name
of the extension.. I do not have the physical file to reference for this, I
just want to make a listing similar to that of the one in explorer's folder
options under the file types tab. Thanks!
Nov 17 '05 #1
9 1899
It is in the registry under HKEY_Classes_Root

--
2004 and 2005 Microsoft MVP C#
Robbe Morris
http://www.masterado.net

Earn $$$ money answering .NET Framework
messageboard posts at EggHeadCafe.com.
http://www.eggheadcafe.com/forums/merit.asp

"Brian Henry" <no****@nospam.microsoft.com> wrote in message
news:OI**************@TK2MSFTNGP15.phx.gbl...
How do you go about getting the "type" of a file from explorer? Say if I
want to know what the type for the extension .DOC was, which is "Micrsoft
Word Document" in explorer, how would I do this? I just want to get the
name of the extension.. I do not have the physical file to reference for
this, I just want to make a listing similar to that of the one in
explorer's folder options under the file types tab. Thanks!

Nov 17 '05 #2
It is in the registry under HKEY_Classes_Root

--
2004 and 2005 Microsoft MVP C#
Robbe Morris
http://www.masterado.net

Earn $$$ money answering .NET Framework
messageboard posts at EggHeadCafe.com.
http://www.eggheadcafe.com/forums/merit.asp

"Brian Henry" <no****@nospam.microsoft.com> wrote in message
news:OI**************@TK2MSFTNGP15.phx.gbl...
How do you go about getting the "type" of a file from explorer? Say if I
want to know what the type for the extension .DOC was, which is "Micrsoft
Word Document" in explorer, how would I do this? I just want to get the
name of the extension.. I do not have the physical file to reference for
this, I just want to make a listing similar to that of the one in
explorer's folder options under the file types tab. Thanks!

Nov 17 '05 #3
Use the SHGetFileInfo function via P/Invoke

-Atul
http://www.ssware.com/
Shell MegaPack - Windows Explorer Shell Controls for ActiveX and .Net
"Brian Henry" <no****@nospam.microsoft.com> wrote in message
news:OI**************@TK2MSFTNGP15.phx.gbl...
How do you go about getting the "type" of a file from explorer? Say if I
want to know what the type for the extension .DOC was, which is "Micrsoft
Word Document" in explorer, how would I do this? I just want to get the
name of the extension.. I do not have the physical file to reference for
this, I just want to make a listing similar to that of the one in
explorer's folder options under the file types tab. Thanks!

Nov 17 '05 #4
Use the SHGetFileInfo function via P/Invoke

-Atul
http://www.ssware.com/
Shell MegaPack - Windows Explorer Shell Controls for ActiveX and .Net
"Brian Henry" <no****@nospam.microsoft.com> wrote in message
news:OI**************@TK2MSFTNGP15.phx.gbl...
How do you go about getting the "type" of a file from explorer? Say if I
want to know what the type for the extension .DOC was, which is "Micrsoft
Word Document" in explorer, how would I do this? I just want to get the
name of the extension.. I do not have the physical file to reference for
this, I just want to make a listing similar to that of the one in
explorer's folder options under the file types tab. Thanks!

Nov 17 '05 #5
yes, but doesn't that require a file that already exists to be passed to it?
I've tried it before with files that exists and got it to work, but never
with just a filename with no physical path to a existing file, which is what
I need.

"Atul" <atulatsswaredotcom> wrote in message
news:uI**************@TK2MSFTNGP12.phx.gbl...
Use the SHGetFileInfo function via P/Invoke

-Atul
http://www.ssware.com/
Shell MegaPack - Windows Explorer Shell Controls for ActiveX and .Net
"Brian Henry" <no****@nospam.microsoft.com> wrote in message
news:OI**************@TK2MSFTNGP15.phx.gbl...
How do you go about getting the "type" of a file from explorer? Say if I
want to know what the type for the extension .DOC was, which is "Micrsoft
Word Document" in explorer, how would I do this? I just want to get the
name of the extension.. I do not have the physical file to reference for
this, I just want to make a listing similar to that of the one in
explorer's folder options under the file types tab. Thanks!


Nov 17 '05 #6
yes, but doesn't that require a file that already exists to be passed to it?
I've tried it before with files that exists and got it to work, but never
with just a filename with no physical path to a existing file, which is what
I need.

"Atul" <atulatsswaredotcom> wrote in message
news:uI**************@TK2MSFTNGP12.phx.gbl...
Use the SHGetFileInfo function via P/Invoke

-Atul
http://www.ssware.com/
Shell MegaPack - Windows Explorer Shell Controls for ActiveX and .Net
"Brian Henry" <no****@nospam.microsoft.com> wrote in message
news:OI**************@TK2MSFTNGP15.phx.gbl...
How do you go about getting the "type" of a file from explorer? Say if I
want to know what the type for the extension .DOC was, which is "Micrsoft
Word Document" in explorer, how would I do this? I just want to get the
name of the extension.. I do not have the physical file to reference for
this, I just want to make a listing similar to that of the one in
explorer's folder options under the file types tab. Thanks!


Nov 17 '05 #7
thanks that helped
"Robbe Morris [C# MVP]" <in**@eggheadcafe.com> wrote in message
news:eP**************@tk2msftngp13.phx.gbl...
It is in the registry under HKEY_Classes_Root

--
2004 and 2005 Microsoft MVP C#
Robbe Morris
http://www.masterado.net

Earn $$$ money answering .NET Framework
messageboard posts at EggHeadCafe.com.
http://www.eggheadcafe.com/forums/merit.asp

"Brian Henry" <no****@nospam.microsoft.com> wrote in message
news:OI**************@TK2MSFTNGP15.phx.gbl...
How do you go about getting the "type" of a file from explorer? Say if I
want to know what the type for the extension .DOC was, which is "Micrsoft
Word Document" in explorer, how would I do this? I just want to get the
name of the extension.. I do not have the physical file to reference for
this, I just want to make a listing similar to that of the one in
explorer's folder options under the file types tab. Thanks!


Nov 17 '05 #8
thanks that helped
"Robbe Morris [C# MVP]" <in**@eggheadcafe.com> wrote in message
news:eP**************@tk2msftngp13.phx.gbl...
It is in the registry under HKEY_Classes_Root

--
2004 and 2005 Microsoft MVP C#
Robbe Morris
http://www.masterado.net

Earn $$$ money answering .NET Framework
messageboard posts at EggHeadCafe.com.
http://www.eggheadcafe.com/forums/merit.asp

"Brian Henry" <no****@nospam.microsoft.com> wrote in message
news:OI**************@TK2MSFTNGP15.phx.gbl...
How do you go about getting the "type" of a file from explorer? Say if I
want to know what the type for the extension .DOC was, which is "Micrsoft
Word Document" in explorer, how would I do this? I just want to get the
name of the extension.. I do not have the physical file to reference for
this, I just want to make a listing similar to that of the one in
explorer's folder options under the file types tab. Thanks!


Nov 17 '05 #9
>yes, but doesn't that require a file that already exists to be passed to it?

No, see

How To Retrieve an Icon for a File Class Without a File
http://support.microsoft.com/?kbid=179167

Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Nov 17 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Roberto | last post by:
1) I have the following html code on the server: <HTML> .... ..... <BODY> <A HREF = http://MyServer/MyDoc.doc> Click here to see the document</A> When I click on the link How Internet...
3
by: zfeld | last post by:
My app is creating a word document which my app calls saveas() and saves it to a given directory that is being watched by a fileSystemWatcher. The problem is that the fileSystemEventHandler for...
8
by: perspicacious | last post by:
Please visit http://epaperpress.com/temp/t.html and click on the link. The link source indicates the filename is unix.tar.gz however, when downloading in ie6, it changes the name to ...
2
by: Brian Henry | last post by:
I want to list out a directory listing along with showing the file type name (like explorer does when it says something like "MyDoc.DOC - Microsoft Word Document" How do I get that file type name...
0
by: Brian Henry | last post by:
How do you go about getting the "type" of a file from explorer? Say if I want to know what the type for the extension .DOC was, which is "Micrsoft Word Document" in explorer, how would I do this? I...
5
by: mike | last post by:
Hi, I have been playing with VB.NET/C# for getting some general properties of a fileinfo object. However, FileInfo object does not seem to expose some of the basic properties like TYPE that used...
1
by: iwdu15 | last post by:
hi, how can i get the icon associated with a certain file type? thanks -- -iwdu15
0
by: rautsmita | last post by:
hello friends , i am using to jdk6 and JAXB2.0, i have geomtry.xsd file i am trying to compile this file using jaxb but i got some error i.e.The particle of the type is not a valid restriction of...
26
by: Don Calloway | last post by:
I have created a <filename>.db1 (where <filenameis the name given to the database) Access database that is being used in multi-user mode. When the <filename>.db1 file is opened by a user, the...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.