Traditional Culture Encyclopedia - Photography and portraiture - Ask a batch of prawns how to automatically create a folder and archive a bunch of photos taken in different periods according to the date of modification.

Ask a batch of prawns how to automatically create a folder and archive a bunch of photos taken in different periods according to the date of modification.

Don't know your actual document/situation, just rely on the explanation and guess in the question; Copy and paste the following code into Notepad, save it as xx.bat, select ANSI as the encoding, and double-click it to run with the file to be processed.

Cls & echo? Close & ampcd? /d? " % ~ dp0 " & ampmode? A scam? Number of rows =5000

Rem? Divide/classify multiple jpg image files in the current directory into different folders according to the modification date or shooting date.

Settings? # = Any? Problems and suggestions. Settings? WX & amp; Settings? $ = Q & ampset/az=0x53b7e0b4

Title? %#%? +%$%%$%/%_%? %z%

Settings? "Current =%cd%"

Rem? 1 is the modification date, and 2 is the shooting date.

Settings? "Date type = 1"

powershell? -No files? -Implement the policy? Bypass? "Get-content? -Literally? % ~ F0“| Out-String | Invoke-Expression”

Echo; %#%? +%$%%$%/%_%? %z%

discontinue

export

# & gt

$ b =[Convert]::from base 64 string(" IC 0 tpia = ");

$c=[Text。 Code]:: Default. GetString($ b);

Add-Type? -Assembly name? ' system . drawing ';

$ current = $ env:current;

$ date type = $ env:date type;

$files=@(dir? -Literally? $current|? {(@(".jpg“,”。 jpeg”)? -Contained? $ _. Extended)? -And then what? ($_? -Really? [system. IO . FileInfo])});

for($ I = 0; $i? Lieutenant? $ files.length$i++){

$ t =“”;

if($datetype? -Emotional intelligence? 1 '){ $ t = $ files[$ I]. lastwritetime . tostring(' yyyy-MM-DD? HH:mm:ss’); }

if($datetype? -Emotional intelligence? '2'){

$img=[System。 drawing . Image]::from file($ files[$ I]。 Full name);

foreach($it? Are you online? $img。 PropertyItems){

If ($ it. Id? -Emotional intelligence? 0x9003){

$ t =[ system. Code ]::ASCII. GetString($it。 Value)? -Replace? \x00$ ',' ';

Break;

}

}

$img。 dispose();

}

If ($t? -ne? ''){

$newfolder=($t.trim()。 Replace (':','-')? -Split? \ s+')[0];

If (-no? (test path? -Literally? $newfolder)){[void][IO。 directory]::create directory($ new folder); }

$files[$i]。 name+$ c+$ new folder;

}

}