HighTechTalks DotNet Forums  

How to test that a file ext is the same as the file type

Dotnet Scripting microsoft.public.dotnet.scripting


Discuss How to test that a file ext is the same as the file type in the Dotnet Scripting forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
=?Utf-8?B?V2hhdFNheUl0QWludFNv?=
 
Posts: n/a

Default How to test that a file ext is the same as the file type - 07-23-2007 , 04:16 PM






I need to test for the circumstance where someone has renamed a TIF file with
a JPG extension. I have to process large number of image files that are
supposed all be JPG files. If I right-click on a file that is really a TIF,
windows can show in the properties that it is a TIF even though it has a JPG
extention. (In the properties window on the Summary tab under the Image node
for File Type the value is “Tagged Information File Format (TIFF)”

My questions are:
1- What is the technical term for this property?
2- How can I test for the condition where this property does not equal the
file extension in the file name?

I am running simple dos commands and a thumbnailer product via command line.
But I am open to more exotic methods.

Thanks in advance…



Reply With Quote
  #2  
Old   
Shay Levi
 
Posts: n/a

Default Re: How to test that a file ext is the same as the file type - 07-23-2007 , 04:46 PM






Check out James O'Neill's blog
http://blogs.technet.com/jamesone/ar...of-course.aspx

or Scott Hanselman's
http://www.hanselman.com/blog/Access...owerShell.aspx


HTH

Shay
http://www.scriptolog.blogspot.com



Quote:
I need to test for the circumstance where someone has renamed a TIF
file with a JPG extension. I have to process large number of image
files that are supposed all be JPG files. If I right-click on a file
that is really a TIF, windows can show in the properties that it is a
TIF even though it has a JPG extention. (In the properties window on
the Summary tab under the Image node for File Type the value is
Tagged Information File Format (TIFF)

My questions are:
1- What is the technical term for this property?
2- How can I test for the condition where this property does not equal
the
file extension in the file name?
I am running simple dos commands and a thumbnailer product via command
line. But I am open to more exotic methods.

Thanks in advance




Reply With Quote
  #3  
Old   
Shay Levi
 
Posts: n/a

Default Re: How to test that a file ext is the same as the file type - 07-23-2007 , 04:46 PM



Check out James O'Neill's blog
http://blogs.technet.com/jamesone/ar...of-course.aspx

or Scott Hanselman's
http://www.hanselman.com/blog/Access...owerShell.aspx


HTH

Shay
http://www.scriptolog.blogspot.com



Quote:
I need to test for the circumstance where someone has renamed a TIF
file with a JPG extension. I have to process large number of image
files that are supposed all be JPG files. If I right-click on a file
that is really a TIF, windows can show in the properties that it is a
TIF even though it has a JPG extention. (In the properties window on
the Summary tab under the Image node for File Type the value is
Tagged Information File Format (TIFF)

My questions are:
1- What is the technical term for this property?
2- How can I test for the condition where this property does not equal
the
file extension in the file name?
I am running simple dos commands and a thumbnailer product via command
line. But I am open to more exotic methods.

Thanks in advance




Reply With Quote
  #4  
Old   
=?Utf-8?B?V2hhdFNheUl0QWludFNv?=
 
Posts: n/a

Default Re: How to test that a file ext is the same as the file type - 07-23-2007 , 05:30 PM



Thank you Shay,
EXIF is the term I was looking for and was guessing the powershell would be
the method, but I lacked some key information which you have pointed me to.
again, thank you.

"Shay Levi" wrote:

Quote:
Check out James O'Neill's blog
http://blogs.technet.com/jamesone/ar...of-course.aspx

or Scott Hanselman's
http://www.hanselman.com/blog/Access...owerShell.aspx


HTH

Shay
http://www.scriptolog.blogspot.com



I need to test for the circumstance where someone has renamed a TIF
file with a JPG extension. I have to process large number of image
files that are supposed all be JPG files. If I right-click on a file
that is really a TIF, windows can show in the properties that it is a
TIF even though it has a JPG extention. (In the properties window on
the Summary tab under the Image node for File Type the value is
“Tagged Information File Format (TIFF)”

My questions are:
1- What is the technical term for this property?
2- How can I test for the condition where this property does not equal
the
file extension in the file name?
I am running simple dos commands and a thumbnailer product via command
line. But I am open to more exotic methods.

Thanks in advance…





Reply With Quote
  #5  
Old   
=?Utf-8?B?V2hhdFNheUl0QWludFNv?=
 
Posts: n/a

Default Re: How to test that a file ext is the same as the file type - 07-23-2007 , 05:30 PM



Thank you Shay,
EXIF is the term I was looking for and was guessing the powershell would be
the method, but I lacked some key information which you have pointed me to.
again, thank you.

"Shay Levi" wrote:

Quote:
Check out James O'Neill's blog
http://blogs.technet.com/jamesone/ar...of-course.aspx

or Scott Hanselman's
http://www.hanselman.com/blog/Access...owerShell.aspx


HTH

Shay
http://www.scriptolog.blogspot.com



I need to test for the circumstance where someone has renamed a TIF
file with a JPG extension. I have to process large number of image
files that are supposed all be JPG files. If I right-click on a file
that is really a TIF, windows can show in the properties that it is a
TIF even though it has a JPG extention. (In the properties window on
the Summary tab under the Image node for File Type the value is
“Tagged Information File Format (TIFF)”

My questions are:
1- What is the technical term for this property?
2- How can I test for the condition where this property does not equal
the
file extension in the file name?
I am running simple dos commands and a thumbnailer product via command
line. But I am open to more exotic methods.

Thanks in advance…





Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.