Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@thaiall
Created October 10, 2017 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thaiall/ebf9a005fa322f559c0f04960fe727b9 to your computer and use it in GitHub Desktop.
Save thaiall/ebf9a005fa322f559c0f04960fe727b9 to your computer and use it in GitHub Desktop.
เล่าเรื่องการคัดลอกภาพ ใน Spotlight บน Windows 10 แชร์ไว้ที่ http://www.thaiall.com/assembly/batch.htm
rem myspotlight.bat
rem Test on Windows 10
rem This batch file can be saved in temporary folder.
rem === 1 : Copy section ===
mkdir %userprofile%\desktop\myspotlight
cd %localappdata%\Packages\Microsoft.Windows.ContentDeliveryManager_cw5n1h2txyewy\LocalState\Assets
copy *.* %userprofile%\desktop\myspotlight
cd %userprofile%\desktop\myspotlight
rem === 2 : Delete small size section ===
FOR %%F IN (*.*) DO ( IF %%~zF LSS 100000 del %%F )
rem === 3 : Rename section ===
ren *.* *.jpg
SET COUNT=1
SET PREFIX=me
FOR /f "tokens=*" %%G IN ('dir /b *.jpg') DO (call :renum "%%G")
GOTO :end
:renum
ren %1 %PREFIX%_%count%.jpg
set /a count+=1
GOTO :EOF
:end
rem === 4 : Open first photo section ===
call explorer %userprofile%\desktop\myspotlight
call explorer me_1.jpg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment