CameraTrace scours the internet searching for photos that were taken with your camera to help police track it down and get it back for you. Lost & Found Tags. Often cameras aren't stolen, they're simply lost. You'll receive a Lost & Found Tag with a unique serial number to put on your camera to help you get it back. Only $10 per camera. The camera just may write the serial number camera ID to the EXIF data of image files when you take snapshots.- 'Doctor told me to get out and walk, so I bought a Canon.' Report Inappropriate Content. Message 5 of 16 (30,407 Views) Reply. 0 Kudos Highlighted.
Tag: windows,powershell,command-line,exif,exiftool
I am using ExifTool to change the camera body serial number to be a unique serial number for each image in a group of images numbering several hundred. The camera body serial number is being used as a second place, in addition to where the serial number for the image is in IPTC, to put the serial number as it takes a little more effort to remove.
The serial number is in the format ###-###-####-#### where the last four digits is the number to increment. The first three groups of digits do not change for each batch I run. I only need to increment that last group of digits.
EXAMPLE I if I have 100 images in my first batch, they would be numbered:
811-010-5469-0001, 811-010-5469-0002, 811-010-5469-0003 ... 811-010-5469-0100
I can successfully drag a group of images onto my ExifTool Shortcut that has the values
and it will change the Exif SerialNumber Tag on the images, but have not been successful in what to add to this to have it increment for each image.
I have tried variations on the below without success:
I realize most likely ExifTool is seeing these as numbers being subtracted in the first line and seeing the second line as a string. I have also tried:
just to see if I can even get it to increment with a basic, single digit number. This also has not worked.
Maybe this cannot be incremented this way and I need to use ExifTool from the command line. If so, I am learning the command line/powershell (Windows), but am still weak in this area and would appreciate some pointers to get started there if this is the route I need to take. I am not afraid to use the command line, just would need a bit more hand holding then normal for a starting point. I also am learning Linux and could do this project from there but again, not afraid to use it, just would need a bit more hand holding to get it done.
I do program in PHP, JavaScript and other languages so code is not foreign to me. Just experience in writing it for the command-line.
If further clarification is needed, please let me know in the comments.
Your help and guidance is appreciated!
You'll probably have to go to the command line rather than rely upon drag and drop as this command relies upon ExifTool's advance formatting.
Exiftool '-SerialNumber<001-001-0001-${filesequence;$_=sprintf('%04d', $_+1 )}' <FILE/DIR>
If you want to be more general purpose and to use the original serial number in the file, you could use
Exiftool '-SerialNumber<${SerialNumber}-${filesequence;$_=sprintf('%04d', $_+1 )}' <FILE/DIR>
This will just add the file count to the end of the current serial number in the image, though if you have images from multiple cameras in the same directory, that could get messy.
As for using the command line, you just need to rename to remove the commands in the parens and then either move it to someplace in the command line's path or use the full path to ExifTool.
As for clarification on your previous attempts, the +=
option is used with numbers and with lists. The SerialNumber tag is usually a string, though that could depend upon where it's being written to.
Batch - Comparing two txt files
windows,batch-file,text,comparison
The code below keep lines from File2.txt from the first line that differ vs. File1.txt on: @echo off setlocal EnableDelayedExpansion rem Redirect the *larger* file as input < File2.txt ( rem Merge it with lines from shorter file for /F 'delims=' %%a in (file1.txt) do ( rem Read the next...
Would using Vagrant be overkill? [on hold]
python,windows,ubuntu,vagrant,virtualbox
What I'm looking for is a way to run Ubuntu on this machine, for development work AND for personal use VirtualBox should be able to provide everything that you need. You can create a VM of your choosing, with or without a GUI and use it for whatever you...
Send email with body consisting of objects
email,powershell,foreach
Also if you want it to look more nice and readable you can do something like this that will spit it out in a table: $body += '<body><table width='560' border='1'><tr>' $bodyArray[0] | ForEach-Object { foreach ($property in $_.PSObject.Properties){$body += '<td>$($property.name)</td>'} } $body += '</tr><tr>' $bodyArray | ForEach-Object { foreach ($property...
Java read bytes from Socket on Linux
linux,windows,sockets,network-programming,raspberry-pi
InputStream input = client.getInputStream(); BufferedReader in = new BufferedReader(new InputStreamReader(input)); Your problem is here. You can't use multiple inputs on a socket when one or more of them is buffered. The buffered input stream/reader will read-ahead and 'steal' data from the other stream. You need to change your protocol so...
Color a cell on the basis of another cell value
html,powershell,powershell-v2.0
You should format your HTML result with a different style if there's a condition. To do that, you declare a variable for data style that should be equal to $normalDataStyle if your condition is false, and a special style if it's true. $redDataStyle='style = 'border: 1px solid black; background: #c00000;...
PowerShell logic to remove objects from Array
arrays,powershell
How about not performing a remove, but just sort on tastecode descending and taking just one first result? $DuplicateMembers = $Fruits | Group-Object Name $DuplicateMembers | ForEach-Object { $Outcome = $_.Group | Sort-Object TasteCode -descending | Select -First 1 $Outcome } This way you should not bother to remove anything...
Loop Issue - Remote Server
You never output $DRIVE anywhere, and the expression for $DRIVE shouldn't be in a scriptblock in the first place. The computer name is repeated several times, because you get the SystemName property for each logical disk object. Also, $OS gets the OS name for the local computer, not the remote...
Remove all folders .old
Get-ChildItem produces a list of objects. Use a pipeline for processing that list: Get-ChildItem 'kiewitplazavdiAppsense_profiles' | Where-Object { $_.Name -like '*.old' } | Remove-Item ...
Apache - finding configuration file path
windows,apache,server
you can use httpd.exe -S it will list the config files used by all VHOSTs
Automate MySQL backup @localhost with mysqldump in Windows 8
mysql,windows,operating-system,scheduled-tasks,mysqldump
I think I've found it. The command to give to the scheduler is cmd.exe. In the parameters, the command file to be executed: /C commandfile.cmd And in commandfile.cmd add date and time (without the slashes, depending on your local settings): @echo off set YEAR=%DATE:~6,4% set MONTH=%DATE:~3,2% set DAY=%DATE:~0,2% 'C:Program FilesMySQLMySQL...
sys.argv in a windows environment
python,windows,python-3.x
You are calling the script wrong Bring up a cmd (command line prompt) and type: cd C:/Users/user/PycharmProjects/helloWorld/ module_using_sys.py we are arguments And you will get the correct output....
How to send Ctrl+S through SendKeys.Send() method to save a file(save as dialog)
c#,.net,windows,sendkeys
I believe you need to use: SendKeys.SendWait('^(s)'); Instead of: SendKeys.SendWait('^%s?'); Have a look at https://msdn.microsoft.com/en-us/library/system.windows.forms.sendkeys.send(v=vs.110).aspx for more information....
Override .gitattributes text=auto in Windows
windows,git,gitattributes,core.autocrlf
.gitattributes overrides all config settings, so it really can't be overridden; it is the 'overrider,' so to speak. While you can simply remove the line, this will cause inconsistent behavior on other developers' machines if they have core.autocrlf=true. So the best bet would be to add the following line to...
How do I select a string from a string and replace it in powershell?
Not the best regex but this would be a good start. You aren't specific about what the line looks like so I will assume that it is on its own line with variable whitespace and or text. Get-ChildItem C:temp*.asp | ForEach-Object{ $file = $_.FullName (Get-Content $file) -replace '(.*UserRightss*)'(.*?)'(.*)','$1('$2')$3' | Set-Content...
Why does Windows Server 2008 think Italy should be in W. European Time?
java,windows,timezone
Do not read anything into the identifiers chosen for Windows time zones. 'W. Europe Standard Time' does not mean anything in particular, other than it's the ID for this specific time zone entry. It is indeed more accurate to state that Italy uses Central European Time, or Central European Summer...
What is the max length of a share path in windows?
c#,windows
See MSDN documentation at https://msdn.microsoft.com/en-us/library/cc249520.aspx, 0x104 = 260 characters. Not a lot... On file shares, NTFS supports file paths of up to 32K characters but for some reason you need to specify, when saving, that you want to use this feature by prefixing your path name with ?, for instance...
Execute a batch file before executing in a shortcut (.lnk)
Get Camera Serial Number Exif
windows,batch-file,lnk
Supply program with parameters to your batch script as follows C:SiemensNX10UGIIsetup_NX10_environment.bat 'C:SiemensNX10UGIIugraf.exe' -nx and improve that batch as follows: rem all the original setup_NX10_environment.bat stuff here %* exit or rem all the original setup_NX10_environment.bat stuff here call %* exit or rem all the original setup_NX10_environment.bat stuff here start ' %*...
I cannot use the msg command in cmd (or batch for that matter). How can I fix this?
windows,batch-file
msg.exe is not available on all Windows platforms in all environments. There is just %SystemRoot%Sysnativemsg.exe (64-bit), but no %SystemRoot%SysWOW64msg.exe (32-bit) on Windows 7 x64 Enterprise. Either the batch file is called with using explicitly %SystemRoot%Sysnativecmd.exe or inside the batch file %SystemRoot%Sysnativemsg.exe is used on a Windows x64 machine while on...
Programmatically accessing TFS history [closed]
c#,.net,powershell,tfs
Shai Raiten's Blog is great for learning the TFS API. For getting file history - read this post: http://blogs.microsoft.co.il/shair/2014/09/10/tfs-api-part-55-source-control-get-history/...
Search for certain UPN suffix
powershell,active-directory
You use Get-ADUser and filter on user principal names that end with @sec213.com: $domain = ([adsi]').distinguishedName $ou = 'OU=users,OU=SEC213,OU=Uofguelph,$domain' $suffix = '@sec213.com' Get-ADUser -Filter 'userPrincipalName -like '*$suffix' -SearchBase $ou ...
Listing directories by content size using C# [closed]
c#,.net,windows,linq
A small example here: class DirectorySize { public string DirectoryName; public long DirectorySizes; } public class Program { static void Main(string[] args) { string[] cDirectories = Directory.GetDirectories('C:'); List<DirectorySize> listSizes = new List<DirectorySize>(); for (int i = 0; i < cDirectories.Length; i++) { long size = GetDirectorySize(cDirectories[i]); if(size != -1) {...
Suppressing system command called from awk script
windows,awk,system
I have no idea what the magical Windows incantations are to control what displays on the terminal but in general instead of calling system() and letting the command it calls produce it's own output that's getting mixed in with the awk output, use getline to read the result of the...
Application is missing required files
c#,.net,windows,winforms,sharpdevelop
Your program is looking for compas.ico inside the build directory, while it probably resides in some other directory in your project.
PowerShell - Convert CSV to XLSX
What is the whole 'gps' part of the script for? The two (gps excel -ErrorAction SilentlyContinue).count lines at the start and end of the script count the number of Excel executables running. gps is the shorthand alias for get-process. You can find out more by doing help gps which...
What is the `.` shorthand for in a PowerShell pipeline?
. is the dot sourcing operator, which runs a script in the current scope rather than a new scope like call operator (i.e. &). That second segment invokes a script block and in that script block defines an advanced function. The advanced function iterates each item in the pipeline and...
Should I use different WSAOVERLAPPED struct for WSASend and WSARecv?
windows,sockets,winsock,winsock2
If you are using event handle (a member of the WSAOVERLAPPED structure) you should definitely use two different structures for sending and receiving.
Increment Serial Number using EXIF
windows,powershell,command-line,exif,exiftool
You'll probably have to go to the command line rather than rely upon drag and drop as this command relies upon ExifTool's advance formatting. Exiftool '-SerialNumber<001-001-0001-${filesequence;$_=sprintf('%04d', $_+1 )}' <FILE/DIR> If you want to be more general purpose and to use the original serial number in the file, you could use...
Run server in cmd in Windows
php,windows,wamp
You'll need to install (or enable) the Socket PHP extension: http://www.php.net/manual/en/sockets.installation.php You can enable the sockets extension on wamp, Wamp Icon -> PHP -> PHP Extensions -> Check php_sockets . If its already checked ,please inform me. Second way, call php in Administrator privilege CMD command line.So please open your...
Programmatically close Windows console application c++
c++,windows,mutex,handle
you can hide it by ShowWindow(GetConsoleWindow(), SW_HIDE); Although I really think you should quit the program instead just closing the console....
Join SQL query Results and Get-ChildItem Results
sql-server,sql-server-2008,powershell
OK so if the SQL query does not have results then NULL is returned and, in essence, nothing is added to the $dbResults array. Instead lets append the results to a custom object. I don't know what PowerShell version you have so I needed to do something that I know...
UAC error while installing Xampp 1.8.35 on windows 8
windows,xampp,localhost
Go to your xampp installation directory. Right click on 'xampp-control' then choose 'Run as administrator' If prompted, choose Yes You do not have to disable UAC. You are simply getting this message because the application was started with normal user rights, while the application needs administrator rights to be able...
String manipulation with batch scripting
windows,string,batch-file,space
your line set temp=%%c is the reason. There are spaces at the end. Use this syntax to avoid unintended spaces: set 'temp=%%c' ...
Unable to edit netbeans.conf
java,windows,netbeans
copy that file and paste in desktop edit what you want then paste into C:Program FilesNetBeans 8.0.2 location its works
PowerShell XML formatting issue
xml,powershell
You're missing a set of parentheses (()) at the end of $XmlWriter.WriteEndElement: $xmlWriter.WriteStartElement('Disk$count') # Add tag for each drive $xmlWriter.WriteElementString('DriveLetter','$DriveLetter') # Write Drive Letter to XML $xmlWriter.WriteElementString('DriveSize','$DriveSize') # Write Drive Size to XML $xmlWriter.WriteElementString('DriveFreeSpace','$DriveFreeSpace') # Write Drive Free Space to XML $xmlWriter.WriteEndElement() # <-- Closing Drive Tag - don't forget...
Recording the time of the start of a screen touch in PsychoPy on Windows
python,windows,touchscreen,psychopy
I've managed this using a hook into the WndProc, it's not pretty but it works. The solution, for posterity: https://github.com/alisdt/pywmtouchhook A brief summary: I used a combination of ctypes and pywin32 (unfortunately neither alone could do the job) to register the target HWND to receive touch messages, and replace its...
Parsing the text file line-by-line using batch script (batch file)
windows,batch-file,scripting,cmd
you don't need to parse the file line by line. @echo off :START cls echo. set /p 'cho=Enter a word: -> ' findstr /i '<%cho%>' yourwords.txt >nul 2>&1 if %errorlevel%0 ( echo. echo Sorry! that word is repeated word. echo. ) else ( echo. echo That is a new word....
How to execute four queries once and then check success or failure?
vb.net,windows,visual-studio-2010,ms-access
There a number of other problems with the code (sql injection, sharing a connection among several commands), but here's a step in the right direction: Try conn.Open() cmdfoods.ExecuteNonQuery() cmdservices.ExecuteNonQuery() cmdreservations.ExecuteNonQuery() bill.ExecuteNonQuery() success = True Catch success = False Finally conn.Close() End Try A more-complete solution: Private Function save_to_data() Dim sql...
How to set the classpath in Windows Command Line correctly
java,windows,command-line,classnotfoundexception
You have add the JAR to the CLASSPATH, not the folder which contains this JAR. So the -cp argument should something be like this C:UsersANNADownloadsSimplifiedConnectionProvider.jar;C:UsersANNADownloadsWindows64_Libjitsithe_name_of_the_JAR.jar.
Why doesn't “go get gopkg.in/…” work while “go get github.com/…” OK?
windows,git,powershell,github,go
The root cause has been found: Because my computer use a web proxy, so I need to set proxy in environment variable: C:Usersxiaona>set https_proxy=https://web-proxy.corp.hp.com:8080/ C:Usersxiaona>set http_proxy=https://web-proxy.corp.hp.com:8080/ C:Usersxiaona>go get -v gopkg.in/fatih/pool.v2 Fetching https://gopkg.in/fatih/pool.v2?go-get=1 Parsing meta tags from https://gopkg.in/fatih/pool.v2?go-get=1 (status code 200) get 'gopkg.in/fatih/pool.v2': found meta tag main.metaImport{Prefix:'gopkg.in/fa tih/pool.v2', VCS:'git',...
Using --check on a md5sum command generated checksum file is failing
powershell,cygwin,md5sum
Using the redirection operator to write the checksums to an output file causes the file to be created with the default encoding (Unicode). md5sum expects an ASCII file. Use Set-Content (or Out-File) to save the file with ASCII encoding: md5sum jira_defect.txt | Set-Content result.md5 -Encoding ASCII You can also work...
bat file script to check if string contains other string
windows,batch-file,cmd
Substring operations are not available in for replaceable parameters. You need to assign the data to a variable and then execute the operation on this variable @echo off setlocal enableextensions disabledelayedexpansion >'tempFile' ( echo bob binson echo ted jones echo binson ) set 'pattern=binson' for /f 'usebackq delims=' %%a in...
Error when adding VideosLibrary capability in app's manifest file
c#,windows,windows-phone,windows-10,windows-10-mobile
I found the answer here. Basically you need to use <uap:Capability Name='VideosLibrary' /> instead of <Capability Name='VideosLibrary' />....
How to create a powershell script that triggers a NuGet Update-Package –reinstall?
powershell,nuget-package
You should run the update command from nuget.exe. One of the parameters of the update command is FileConflictAction, which tells what action to take when asked to overwrite or ignore existing files referenced by the project: overwrite, Ignore, None. You might have to wrap everything in a powershell script, possibly...
How to retrieve the name and path of VM's through powercli
If the text infront and including 'Resources' is redundant then using a simple regex we can replacing it before it is output from your function. From $path to $path -replace '^.*?Resources/' So that would replace the similar line inside your function ( Where you return the property). We take everything...
CPU usage missing from log for some processes
You can't get CPU for some processes because of insufficient rights. You get null value then. To output 'Nothing' you have to compare the cpu value with $null, something like this: [email protected]{Expression={$_.ProcessName};Label='ProcessName';Width=40},@{Expression={$cpu=$_.CPU;if($cpu -eq $null){'Nothing';} else {$cpu;}};Label='CPU';Width=20} $ServiceTable = @{Expression={$_.Name};Label='Name';Width=40},@{Expression={$_.Status};Label='Status';Width=10} Get-Process | Sort-Object CPU -Descending | Select-Object ProcessName, CPU | format-table...
String parsing with batch scripting
windows,string,parsing,batch-file,xml-parsing
This should work: @ECHO OFF SETLOCAL ENABLEDELAYEDEXPANSION FOR /F 'tokens=*' %%a in (pictures.xml) DO ( SET b=%%a SET b=!b:'=+! FOR /F 'delims=+ tokens=2' %%c in ('!b!') DO ( ECHO %%c ) ) This will output only something.jpg. Here the expülanation: First we split the file into lines. Now we want...
Get IP address of the Network Adapter of a computer having No gateway
powershell,ip-address,gateway
$configs=gwmi win32_networkadapterconfiguration | where {$_.ipaddress -ne $null -and $_.defaultipgateway -eq $null} if ($configs -ne $null) { $yourtargetIP= $configs[0].IPAddress[0] } # $yourtargetIP will have the IP address to make the gateway from In fact, should you have more than one IPv4 address on your network card, $configs[0].IPAddress will have them all,...
Format a command in powershell including a comma, can't find the right way to escape
powershell,batch-file,escaping,powershell-v2.0,comma
Canon Camera Serial Number Exif
'.pacli DELETEUSER DESTUSER='[email protected]`,com' sessionid=333' You have double quotes in single quotes in double quotes, so the inner double quotes will terminate the string, so this will be parsed as three values: '.pacli DELETEUSER DESTUSER=' [email protected]`,com ' sessionid=333' The answer is to escape, with a back tick (`), the inner...
Comments are closed.