as many of you guys know when we take a picture with our camera and then send it to our computer if we open the propertes
we can see the model and the company name of the camera!
now i want to save this model and company name into a text file
but i just dont know how!
i though it will be possible using wmic to get the info i need but i did not see anything in wmic helps that can do this job
so i want to ask is this possible to do?
its okey if i can use poweshell or vbs just want to do it using a script
getting camera info from bath file?
Moderator: DosItHelp
Re: getting camera info from bath file?
well i am still looking for a way using vbs,cmd,powershell
but if no luck then i will use this
tnx my friend.
but if no luck then i will use this
tnx my friend.
Re: getting camera info from bath file?
tcpman wrote:well i am still looking for a way using vbs,cmd,powershell
Here's all I'm willing to provide: (this isn't a powershell group)
Get-ImgCamNfo.ps1
Code: Select all
param([string]$path = (get-location),
[string]$fileType = ".jpg")
clear
Add-Type -AssemblyName System.Drawing
$filter = "*" + $fileType
$Encode = new-object System.Text.ASCIIEncoding
$files = get-childitem -recurse $path -filter $filter
$image = $null
$filesource = $null
if ($files -ne $null)
{
foreach ($file in $files)
{
$image = [System.Drawing.Imaging.Metafile]::FromFile($file.FullName)
try
{
$filesource = $image.GetPropertyItem(41728).Value[0]
$makerByte = $image.GetPropertyItem(271)
$imageMaker = $Encode.GetString($makerByte.Value)
$modelByte = $image.GetPropertyItem(272)
$imageModel = $Encode.GetString($modelByte.Value)
$image.Dispose()
}
catch
{
}
if(($filesource -eq 3) -and ($imageMaker -ne $null) -and ($imageModel -ne $null))
{
write $file.fullname $imageMaker $imageModel `r`n
}
}
}
else
{
Write-Host "No files found"
}
Code: Select all
.\Get-ImgCamNfo.ps1 -path F:\Data\MyPics -fileType .jpg
Re: getting camera info from bath file?
thank you !
you saved my day!
you saved my day!
Re: getting camera info from bath file?
Compo wrote:Here's all I'm willing to provide: (this isn't a powershell group)
So please do not provide Powershell code here, except in hybrid cmd shell command files.
Thank you
Re: getting camera info from bath file?
Endoro wrote:Compo wrote:Here's all I'm willing to provide: (this isn't a powershell group)
So please do not provide Powershell code here, except in hybrid cmd shell command files.
Thank you
How ironic that three days after my solution and its subsequent acknowledgement that you should highlight the pointlessness of my content!