473,761 Members | 9,864 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 1950
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
2319
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
6265
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
4852
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
8873
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
3803
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
2431
by: iwdu15 | last post by:
hi, how can i get the icon associated with a certain file type? thanks -- -iwdu15
0
2630
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
3611
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
9345
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,...
0
9957
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9905
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
8780
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
7332
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
5229
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
5373
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
3456
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2752
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.