2016-10-27 72 views
0

我正在嘗試獲取圖像的文件大小,以便我可以將它們與兩個stander 1920x1080或1080x1920中的一個進行比較。如果我的圖片與我想刪除它們的標準不匹配。我試圖做到這一點的原因是,當我從Windows Spotlight文件夾中拉出圖像時,我可以對它們進行排序並刪除不匹配的文件。我沒有太多,但這裏是我的代碼庫比較中的圖像像素大小.Bat

xcopy %localappdata%\Packages\Microsoft.Windows.ContentDeliveryManager_cw5n1h2txyewy\LocalState\Assets C:\Users\%Username%\Pictures\"Windows Spotlight" 
D 
cd \ 
cd Users\%Username%\Pictures\"Windows Spotlight" 
ren * *.jpg 

https://github.com/CamoJackson/WinSpotlight-Copy。我看了一下WMIC,但我對此不夠了解。有任何想法嗎。

編輯:我看了一下目錄,我嘗試使用的文件都在200mb以上,我不想要的文件在100MB以下。使用〜zA我可以比較該文件的大小。

+0

1.通過[編輯](http:// stack overflow.com/posts/40290822/edit)你的問題;提供一個鏈接是不好的,因爲鏈接可能在將來變得無效(你可以另外提供鏈接);此外,你期待幫助,所以你應該儘可能地幫助你。 2. Windows命令提示符不能解析圖像文件,因此您需要一些外部工具;選擇一個並在你的問題中提及它(也許有一個相關標籤可用)。 – aschipfl

+0

檢查[this](https://github.com/npocmaka/batch.scripts/blob/master/hybrids/jscript/imgInfo.bat)或[this](https://github.com/npocmaka/batch.scripts /blob/master/hybrids/jscript/tooltipInfo.bat) – npocmaka

+2

或[this](http://stackoverflow.com/q/36585278/1683264) – rojo

回答

0

或者用BAT/VBS:

針對圖像尺寸使用的值:

例如:

GetMediaInfo.bat 「Path_to_the_folder」 「IMAGE_NAME」 的可能值31

::GetMediaInfo.bat 
::By SachaDee - 2016 

::Usage 
::GetMediaInfo.bat "Folder" "File" "Value of the Info to GET" 

::Possible Value Example : 

:: 27 = Media Duration for video or music files 
:: 28 = Bits Rate in Kbs/s 
:: 31 = Dimensions of an image 


::Output 
::Information du media 
@echo off 

    If not exist "#.vbs" call:construct 
    For /f "delims=" %%a in ('cscript //nologo #.vbs "%~1" "%~2" "%~3"') do set $MediaInfo=%%a 

echo %$MediaInfo% 
exit/b 

:construct 
(echo.dim objShell&echo.dim objFolder&echo.dim objFolderItem&echo.set objShell = CreateObject("shell.application"^)&echo.set objFolder = objShell.NameSpace(wscript.arguments(0^)^)&echo.set objFolderItem = objFolder.ParseName(wscript.arguments(1^)^)&echo.dim objInfo&echo.objInfo = objFolder.GetDetailsOf(objFolderItem, wscript.arguments(2^)^)&echo.wscript.echo objinfo)>#.vbs 

表(依賴於文件類型的):

Name - 0 
Size - 1 
Item type - 2 
Date modified - 3 
Date created - 4 
Date accessed - 5 
Attributes - 6 
Offline status - 7 
Offline availability - 8 
Perceived type - 9 
Owner - 10 
Kind - 11 
Date taken - 12 
Contributing artists - 13 
Album - 14 
Year - 15 
Genre - 16 
Conductors - 17 
Tags - 18 
Rating - 19 
Authors - 20 
Title - 21 
Subject - 22 
Categories - 23 
Comments - 24 
Copyright - 25 
Length - 27 
Bit rate - 28 
Protected - 29 
Camera model - 30 
Dimensions - 31 
Camera maker - 32 
Company - 33 
File description - 34 
Program name - 35 
Duration - 36 
Is online - 37 
Is recurring - 38 
Location - 39 
Optional attendee addresses - 40 
Optional attendees - 41 
Organizer address - 42 
Organizer name - 43 
Reminder time - 44 
Required attendee addresses - 45 
Required attendees - 46 
Resources - 47 
Meeting status - 48 
Free/busy status - 49 
Total size - 50 
Account name - 51 
Task status - 52 
Computer - 53 
Anniversary - 54 
Assistant's name - 55 
Assistant's phone - 56 
Birthday - 57 
Business address - 58 
Business city - 59 
Business P.O. box - 60 
Business postal code - 61 
Business state or province - 62 
Business street - 63 
Business fax - 64 
Business home page - 65 
Business phone - 66 
Callback number - 67 
Car phone - 68 
Children - 69 
Company main phone - 70 
Department - 71 
E-mail address - 72 
E-mail2 - 73 
E-mail3 - 74 
E-mail list - 75 
E-mail display name - 76 
File as - 77 
First name - 78 
Full name - 79 
Gender - 80 
Given name - 81 
Hobbies - 82 
Home address - 83 
Home city - 84 
Home country/region - 85 
Home P.O. box - 86 
Home postal code - 87 
Home state or province - 88 
Home street - 89 
Home fax - 90 
Home phone - 91 
IM addresses - 92 
Initials - 93 
Job title - 94 
Label - 95 
Last name - 96 
Mailing address - 97 
Middle name - 98 
Cell phone - 99 
Cell phone - 100 
Nickname - 101 
Office location - 102 
Other address - 103 
Other city - 104 
Other country/region - 105 
Other P.O. box - 106 
Other postal code - 107 
Other state or province - 108 
Other street - 109 
Pager - 110 
Personal title - 111 
City - 112 
Country/region - 113 
P.O. box - 114 
Postal code - 115 
State or province - 116 
Street - 117 
Primary e-mail - 118 
Primary phone - 119 
Profession - 120 
Spouse/Partner - 121 
Suffix - 122 
TTY/TTD phone - 123 
Telex - 124 
Webpage - 125 
Content status - 126 
Content type - 127 
Date acquired - 128 
Date archived - 129 
Date completed - 130 
Device category - 131 
Connected - 132 
Discovery method - 133 
Friendly name - 134 
Local computer - 135 
Manufacturer - 136 
Model - 137 
Paired - 138 
Classification - 139 
Status - 140 
Client ID - 141 
Contributors - 142 
Content created - 143 
Last printed - 144 
Date last saved - 145 
Division - 146 
Document ID - 147 
Pages - 148 
Slides - 149 
Total editing time - 150 
Word count - 151 
Due date - 152 
End date - 153 
File count - 154 
Filename - 155 
File version - 156 
Flag color - 157 
Flag status - 158 
Space free - 159 
Bit depth - 160 
Horizontal resolution - 161 
Width - 162 
Vertical resolution - 163 
Height - 164 
Importance - 165 
Is attachment - 166 
Is deleted - 167 
Encryption status - 168 
Has flag - 169 
Is completed - 170 
Incomplete - 171 
Read status - 172 
Shared - 173 
Creators - 174 
Date - 175 
Folder name - 176 
Folder path - 177 
Folder - 178 
Participants - 179 
Path - 180 
By location - 181 
Type - 182 
Contact names - 183 
Entry type - 184 
Language - 185 
Date visited - 186 
Description - 187 
Link status - 188 
Link target - 189 
URL - 190 
Media created - 191 
Date released - 192 
Encoded by - 193 
Producers - 194 
Publisher - 195 
Subtitle - 196 
User web URL - 197 
Writers - 198 
Attachments - 199 
Bcc addresses - 200 
Bcc - 201 
Cc addresses - 202 
Cc - 203 
Conversation ID - 204 
Date received - 205 
Date sent - 206 
From addresses - 207 
From - 208 
Has attachments - 209 
Sender address - 210 
Sender name - 211 
Store - 212 
To addresses - 213 
To do title - 214 
To - 215 
Mileage - 216 
Album artist - 217 
Album ID - 218 
Beats-per-minute - 219 
Composers - 220 
Initial key - 221 
Part of a compilation - 222 
Mood - 223 
Part of set - 224 
Period - 225 
Color - 226 
Parental rating - 227 
Parental rating reason - 228 
Space used - 229 
EXIF version - 230 
Event - 231 
Exposure bias - 232 
Exposure program - 233 
Exposure time - 234 
F-stop - 235 
Flash mode - 236 
Focal length - 237 
35mm focal length - 238 
ISO speed - 239 
Lens maker - 240 
Lens model - 241 
Light source - 242 
Max aperture - 243 
Metering mode - 244 
Orientation - 245 
People - 246 
Program mode - 247 
Saturation - 248 
Subject distance - 249 
White balance - 250 
Priority - 251 
Project - 252 
Channel number - 253 
Episode name - 254 
Closed captioning - 255 
Rerun - 256 
SAP - 257 
Broadcast date - 258 
Program description - 259 
Recording time - 260 
Station call sign - 261 
Station name - 262 
Summary - 263 
Snippets - 264 
Auto summary - 265 
Search ranking - 266 
Sensitivity - 267 
Shared with - 268 
Sharing status - 269 
Product name - 270 
Product version - 271 
Support link - 272 
Source - 273 
Start date - 274 
Billing information - 275 
Complete - 276 
Task owner - 277 
Total file size - 278 
Legal trademarks - 279 
Video compression - 280 
Directors - 281 
Data rate - 282 
Frame height - 283 
Frame rate - 284 
Frame width - 285 
Total bitrate - 286 
+0

謝謝@aschipfl :) – SachaDee