473,698 Members | 2,339 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1940
It is in the registry under HKEY_Classes_Ro ot

--
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******** ******@TK2MSFTN GP15.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_Ro ot

--
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******** ******@TK2MSFTN GP15.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******** ******@TK2MSFTN GP15.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******** ******@TK2MSFTN GP15.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" <atulatsswaredo tcom> wrote in message
news:uI******** ******@TK2MSFTN GP12.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******** ******@TK2MSFTN GP15.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" <atulatsswaredo tcom> wrote in message
news:uI******** ******@TK2MSFTN GP12.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******** ******@TK2MSFTN GP15.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**@eggheadca fe.com> wrote in message
news:eP******** ******@tk2msftn gp13.phx.gbl...
It is in the registry under HKEY_Classes_Ro ot

--
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******** ******@TK2MSFTN GP15.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**@eggheadca fe.com> wrote in message
news:eP******** ******@tk2msftn gp13.phx.gbl...
It is in the registry under HKEY_Classes_Ro ot

--
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******** ******@TK2MSFTN GP15.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
2314
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 Explorer understand that it's a Word Document and It's necessary open it with Microsoft Word ? Is The extension
3
6254
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 creation is only called for the temporary filed created by word which shows up as ~$documentName.doc the real file named MyDocument.doc will never invoke the fileSystemEventHandler for creation. Now when the user closes Word the temporary file is...
8
4850
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 unix.tar.tar What's going on?
2
8870
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 which is Microsoft Word Document based on the extension or what ever it needs to figure out the type so i can display it in a program? also is there a simple way to get the icon of the file type? I've seen complex ways before, but is there any...
0
321
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 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!
5
3796
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 to be available in "FileSystemObject" of ScriptingLibrary. For example the "TYPE" property should return "Text Document" or "Microsoft Office Document" or "Visual Studio Code File" and so on. similar to the properties displayed by Properties...
1
2425
by: iwdu15 | last post by:
hi, how can i get the icon associated with a certain file type? thanks -- -iwdu15
0
2626
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 the particle of the base this xsd file is valid as per w3c standard i am also providing error in detail and geometry.xsd file geometry.xsd <?xml version="1.0" encoding="UTF-8"?> <schema targetNamespace="http://www.opengis.net/gml"...
26
3599
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 corresponding locking file appears in the Windows Explorer view pane as well as expected. Occasionally, a "bare" db1 file (extension only without a filename) appears in the Windows Explorer window. Can anyone tell me what that file is and what it...
0
8603
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8895
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7725
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6518
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5860
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4369
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4619
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3046
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2329
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.