-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathRCFI Tools.bat
More file actions
4404 lines (4034 loc) · 162 KB
/
RCFI Tools.bat
File metadata and controls
4404 lines (4034 loc) · 162 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
@echo off
:: Update v0.6
:: 2025-01-04 Fixed: a slight typo in RCFI.templates.ini causing a variable to disable using logo as a folder name not working.
:: 2025-01-09 Added: New configuration to disable the file selection dialog. (requested in #19)
setlocal
set name=RCFI Tools
set version=v0.6
chcp 65001 >nul
PUSHD "%~dp0"
title %name% "%cd%"
:Start
set "xSelectedCount=0"
if defined xSelected for %%S in (%xSelected%) do set /a xSelectedCount+=1
set "SelectedThing=%~f1"
set "SelectedThingPath=%~dp1"
:Varset
rem Define color palette and some variables
set "g_=[90m"
set "gg_=[32m"
set "gn_=[92m"
set "u_=[4m"
set "w_=[97m"
set "r_=[31m"
set "rr_=[91m"
set "b_=[34m"
set "bb_=[94m"
set "bk_=[30m"
set "y_=[33m"
set "yy_=[93m"
set "c_=[36m"
set "cc_=[96m"
set "_=[0m"
set "-=[0m[30m-[0m"
set "i_=[7m"
set "p_=[35m"
set "pp_=[95m"
set "ntc_=%_%%I_%%W_% %_%%-%"
set "TAB= "
set ESC=[30m"[0m
set "AST=%R_%*%_%"
rem Initiating variables for FI-Scan-Desktop.ini
set "yy_result=0"
set "y_result=0"
set "g_result=0"
set "r_result=0"
set "h_result=0"
set "Y_d=1"
set "G_d=1"
set "R_d=1"
set "YY_d=1"
set "success_result=0"
set "fail_result=0"
rem Storing required file path
set p1=ping localhost -n 1 ^>nul
set p2=ping localhost -n 2 ^>nul
set p3=ping localhost -n 3 ^>nul
set p4=ping localhost -n 4 ^>nul
set p5=ping localhost -n 5 ^>nul
set "RCFI=%~dp0"
set "RCFI=%RCFI:~0,-1%"
set "RCFID=%RCFI%\uninstall.cmd"
set "Converter=%RCFI%\resources\Convert.exe"
set "montage=%RCFI%\resources\montage.exe"
set "FI-Update=%RCFI%\resources\FolderIconUpdater.exe"
set "ImageSupport=.jpg,.png,.ico,.webp,.wbmp,.bmp,.svg,.jpeg,.tiff,.heic,.heif,.tga"
set "ImageFilter=*.jpg;*.png;*.ico;*.webp;*.wbmp;*.bmp;*.svg;*.jpeg;*.tiff;*.heic;*.heif;*.tga"
set "TemplateSampleImage=%RCFI%\images\- test.jpg"
set "RCFI.config.ini=%RCFI%\RCFI.config.ini"
set "RCFI.templates.ini=%RCFI%\RCFI.templates.ini"
set "timestart="
rem Load some variables from RCFI.config.ini
call :Config-Load
if /i "%Setup%"=="Deactivate" (
echo.&echo.&echo.
echo Deactivating>"%RCFI%\resources\deactivating.RCFI"
)
rem Updating / reset some variables
if exist "%DrivePath%" (PUSHD "%DrivePath%") else (PUSHD "%~dp0")
set "VarUpdate-referer=Start_script"
:VarUpdate
title %name% %version% "%cd%"
set "result=0"
set "keywordsFind=*%keywords%*"
set "keywordsFind=%keywordsFind: =*%"
set "keywordsFind=%keywordsFind:.=*%
set "keywordsFind=%keywordsFind:(=%"
set "keywordsFind=%keywordsFind:)=%"
set "keywordsFind=%keywordsFind:,=*,*%"
for %%X in (%ImageSupport%) do (
set ImgExtS=%%X
call :FI-Keyword-ImageSupport
)
call set "KeywordsPrint=%%Keywords:,=%C_%,%_%%%"
for %%T in ("%Template%") do set "TemplateName=%%~nT"
if not defined VarUpdate-referer EXIT /B
set "VarUpdate-referer="
:RefreshCheck
if /i "%act%"=="Refresh" goto FI-Refresh
if /i "%act%"=="RefreshNR" goto FI-Refresh-NoRestart
if /i "%act%"=="FI-Template-Sample-All" goto FI-Template-Sample-All
if /i "%Context%"=="Refresh.Here" PUSHD "%SelectedThing%" &set "cdonly=false" &set "RefreshOpen=Index" &goto FI-Refresh
if /i "%Context%"=="RefreshNR.Here" PUSHD "%SelectedThing%" &set "cdonly=false" &set "RefreshOpen=Index" &goto FI-Refresh-NoRestart
:Setup
if /i "%setup%" EQU "Deactivate" set "setup_select=2" &goto Setup-Choice
if exist "%RCFI%\resources\deactivating.RCFI" set "Setup=Deactivate" &set "setup_select=2" &goto Setup-Choice
if exist "%RCFID%" (
for /f "useback tokens=1,2 delims=:" %%S in ("%RCFID%") do set /a "InstalledRelease=%%T" 2>nul
call :Setup-Update
goto Intro
) else echo.&echo.&echo.&set "setup_select=1" &goto Setup-Choice
echo.&echo.&echo.
Goto Setup-Options
:Intro
if defined Context goto Input-Context
echo.
echo.
echo.
echo.
if not defined OpenFrom (
echo %I_% %name% %version% %_%%-%
echo.
echo %GN_%Activate%G_%/%GN_%Act%G_% to activate Folder Icon Tools.
echo %GN_%Deactivate%G_%/%GN_%Dct%G_% to deactivate Folder Icon Tools.
echo.
) else (
echo %TAB% %PP_%Drag and drop%_%%G_% an %C_%image%G_% into this window,
echo %TAB% then press Enter to change the folder icon.
echo.
echo.
echo %C_%O%G_% to open file selection dialog. %C_%C%G_% to open Collections folder.
)
goto Options-Input
:Status
%p1%
echo %_%------- Current Status ----------------------------------------
echo Directory :%ESC%%U_%%cd%%-%%ESC%
echo Keywords : %KeywordsPrint%
if exist "%Template%" ^
echo Template :%ESC%%CC_%%templatename%%_%%ESC%
if not exist "%Template%" ^
echo Template : %R_%%I_% Not Found! %ESC%%R_%%U_%%Template%%ESC%
echo %_%---------------------------------------------------------------
goto Options-Input
:Options
title %name% %version% "%CD%"
echo.&echo.&echo.&echo.
set "Already="
set "referer="
if defined timestart call :timer-end
set "timestart="
if /i "%Context%"=="refresh.NR" exit
if exist "%RCFI%\resources\FolderUpdater_list.txt" call :FI-Updater
if defined Context (
if %exitwait% GTR 99 (
echo.&echo.
echo %TAB%%G_%%processingtime% Press Any Key to Close this window.
endlocal
pause>nul&exit
)
echo. &echo.
if /i "%input%"=="Scan" (
echo %TAB%%TAB%%G_%%processingtime% Press any key to close this window.
endlocal
pause >nul &exit
)
if /i "%cdonly%"=="true" (
echo %TAB%%G_%%processingtime% This window will close in %ExitWait% sec.
endlocal
ping localhost -n %ExitWait% >nul&exit
)
if /i "%input%"=="Generate" (
echo %TAB%%TAB%%G_%%processingtime% Press any key to close this window.
endlocal
pause >nul &exit
)
echo %TAB%%G_%%processingtime% This window will close in %ExitWait% sec.
endlocal
ping localhost -n %ExitWait% >nul&exit
)
:Options-Input
if defined OpenFrom if /i not "%TemplateAlwaysAsk%"=="yes" echo %G_%Template:%ESC%%CC_%%TemplateName%%ESC%
echo %G_%--------------------------------------------------------------------------------------------------
title %name% %version% "%cd%"
call :Config-Save
call :VarUpdate
call :Config-Load
:Input-Command
for %%F in ("%cd%") do set "FolderName=%%~nxF"
if not defined OpenFrom set "FolderName=%cd%"
set "Command=(none)"
set "FolderName=%FolderName:&=^&%"
if defined OpenFrom (
if exist "%SelectorSelectedFile%" (
echo %YY_%📁%ESC%%YY_%%FolderName%%ESC%
set "command=%SelectorSelectedFile%"
set "SelectorSelectedFile="
echo %_%%W_%Selected file:%C_%"%SelectorSelectedFile%"
) else (
echo %YY_%📁%ESC%%YY_%%FolderName%%ESC%
set /p "Command=%_%%W_%Enter the image path:%_%%C_%"
)
)
if not defined OpenFrom (
if exist "%SelectorSelectedFile%" (
set "command=%SelectorSelectedFile%"
set "SelectorSelectedFile="
echo Selected file:%C_%"%SelectorSelectedFile%"%_%
) else (
echo %G_%%I_%%ESC%%G_%%FolderName%%ESC%
set /p "Command=%I_%%GN_% %_%%GN_%"
)
)
set "Command=%Command:"=%"
echo %-% &echo %-%
if /i "%Command%"=="keyword" goto FI-Keyword
if /i "%Command%"=="keywords" goto FI-Keyword
if /i "%Command%"=="keyword:" goto Status
if /i "%Command%"=="ky" goto FI-Keyword
if /i "%Command%"=="key" goto FI-Keyword
if /i "%Command%"=="scan" set "recursive=no" &set "input=Scan" &goto FI-Scan
if /i "%Command%"=="sc" set "recursive=no" &set "input=Scan" &goto FI-Scan
if /i "%Command%"=="scans" set "recursive=yes" &set "input=Scan" &goto FI-Scan
if /i "%Command%"=="scs" set "recursive=yes" &set "input=Scan" &goto FI-Scan
if /i "%Command%"=="generate" set "recursive=no" &set "cdonly=false" &set "input=Generate" &goto FI-Generate
if /i "%Command%"=="gen" set "recursive=no" &set "cdonly=false" &set "input=Generate" &goto FI-Generate
if /i "%Command%"=="generates" set "recursive=yes" &set "cdonly=false" &set "input=Generate" &goto FI-Generate
if /i "%Command%"=="gens" set "recursive=yes" &set "cdonly=false" &set "input=Generate" &goto FI-Generate
if /i "%Command%"=="Remove" set "recursive=no" &set "cdonly=false" &set "delete=ask" &goto FI-Remove
if /i "%Command%"=="Rem" set "recursive=no" &set "cdonly=false" &set "delete=ask" &goto FI-Remove
if /i "%Command%"=="Removes" set "recursive=yes" &set "cdonly=false" &set "delete=ask" &goto FI-Remove
if /i "%Command%"=="Rems" set "recursive=yes" &set "cdonly=false" &set "delete=ask" &goto FI-Remove
if /i "%Command%"=="Rename" set "recursive=no" &set "rename=Ask" &goto FI-Rename
if /i "%Command%"=="Ren" set "recursive=no" &set "rename=Ask" &goto FI-Rename
if /i "%Command%"=="Renames" set "recursive=yes" &set "rename=Ask" &goto FI-Rename
if /i "%Command%"=="Rens" set "recursive=yes" &set "rename=Ask" &goto FI-Rename
if /i "%Command%"=="Move" set "recursive=no" &set "rename=Ask" &goto FI-Move
if /i "%Command%"=="Mov" set "recursive=no" &set "Move=Ask" &goto FI-Move
if /i "%Command%"=="Moves" set "recursive=yes" &set "Move=Ask" &goto FI-Move
if /i "%Command%"=="Movs" set "recursive=yes" &set "Move=Ask" &goto FI-Move
if /i "%Command%"=="Hide" set "recursive=no" &goto FI-Hide
if /i "%Command%"=="Hid" set "recursive=no" &goto FI-Hide
if /i "%Command%"=="Hides" set "recursive=yes" &goto FI-Hide
if /i "%Command%"=="Hids" set "recursive=yes" &goto FI-Hide
if /i "%Command%"=="on" set "refreshopen=index" &goto FI-Activate
if /i "%Command%"=="off" set "refreshopen=index" &goto FI-Deactivate
if /i "%Command%"=="copy" goto CopyFolderIcon
if /i "%Command%"=="refresh" echo %TAB%%CC_%Refreshing icon cache..%_%&set "act=RefreshNR" &start "" "%~f0" &goto options
if /i "%Command%"=="refreshforce" echo %TAB%%CC_%Refreshing icon cache..%_%&set "act=Refresh" &start "" "%~f0" &goto options
if /i "%Command%"=="rf" echo %TAB%%CC_%Refreshing icon cache..%_%&set "act=RefreshNR" &start "" "%~f0" &goto options
if /i "%Command%"=="rff" echo %TAB%%CC_%Refreshing icon cache..%_%&set "act=Refresh" &start "" "%~f0" &goto options
if /i "%Command%"=="template" set "refer=Choose.Template"&goto FI-Template
if /i "%Command%"=="template:" goto Status
if /i "%Command%"=="tp" set "refer=Choose.Template"&goto FI-Template
if /i "%Command%"=="Tes" goto FI-Template-Sample
if /i "%Command%"=="s" goto Status
if /i "%Command%"=="help" goto Help
if /i "%Command%"=="cd.." PUSHD .. &echo %TAB% Changing to the parent directory. &goto options
if /i "%Command%"==".." PUSHD .. &echo %TAB% Changing to the parent directory. &goto options
if /i "%Command%"=="RCFI" echo %TAB%%_% Opening.. &echo %TAB%%ESC%%I_%%~dp0%ESC% &echo. &explorer.exe "%~dp0" &goto options
if /i "%Command%"=="open" echo %TAB%%_% Opening.. &echo %TAB%%ESC%%I_%%~dp0%ESC% &echo. &explorer.exe "%~dp0" &goto options
if /i "%Command%"=="o" set "initDir=default"&set "FS-referer=cmd"&goto FI-File_Selector
if /i "%Command%"=="c" set "initDir=collect"&set "FS-referer=cmd"&goto FI-File_Selector
if /i "%Command%"=="cls" cls&goto options
if /i "%Command%"=="r" start "" "%~f0" &exit
if /i "%Command%"=="tc" goto Colour
if /i "%Command%"=="search" set "Context=FI.Search.Folder.Icon.Here"&echo %TAB%Opening search..&start "" "%~f0" &set "Context="&goto options
if /i "%Command%"=="sr" set "Context=FI.Search.Folder.Icon.Here"&echo %TAB%Opening search..&start "" "%~f0" &set "Context="&goto options
if /i "%Command%"=="setup" goto Setup-Options
if /i "%Command%"=="Activate" set "Setup_Select=1" &goto Setup-Choice
if /i "%Command%"=="Deactivate" set "Setup_Select=2" &goto Setup-Choice
if /i "%Command%"=="uninstall" set "Setup_Select=2" &goto Setup-Choice
if /i "%Command%"=="Act" set "Setup_Select=1" &goto Setup-Choice
if /i "%Command%"=="Dct" set "Setup_Select=2" &goto Setup-Choice
if /i "%Command%"=="Deact" set "Setup_Select=2" &goto Setup-Choice
if /i "%Command%"=="config" goto config
if /i "%Command%"=="cfg" goto config
if /i "%Command%"=="cmd" cls&cmd.exe
if exist "%Command%" set "input=%command:"=%"&goto directInput
goto Input-Error
:Input-Context
title %name% %version% ^| "%cd%"
set Dir=PUSHD "%SelectedThing%"
set SetIMG=set "img=%SelectedThing%"
cls
echo. &echo. &echo.
REM Selected Image
if /i "%Context%"=="IMG-Actions" goto IMG-Actions
if /i "%Context%"=="IMG-Set.As.Folder.Icon" PUSHD "%SelectedThingPath%" &set "input=%SelectedThing%"&set "RefreshOpen=Select" &goto DirectInput
if /i "%Context%"=="IMG.Add.to.collections" goto IMG-Add_to_collections
if /i "%Context%"=="IMG.Choose.Template" %setIMG%&set "refer=Choose.Template"&goto FI-Template
if /i "%Context%"=="IMG.Edit.Template" start "" notepad.exe "%template%"&exit
if /i "%Context%"=="IMG.Template.Samples" %setIMG%&goto FI-Template-Sample-All
if /i "%Context%"=="IMG.Generate.icon" goto IMG-Generate_icon
if /i "%Context%"=="IMG.Generate.PNG" goto IMG-Generate_icon
if /i "%Context%"=="IMG-Set.As.Cover" %setIMG%&goto IMG-Set_as_MKV_cover
if /i "%Context%"=="IMG-Convert" goto IMG-Convert
if /i "%Context%"=="IMG-Resize" goto IMG-Resize
if /i "%Context%"=="IMG-Compress" goto IMG-Compress
REM Selected Dir
if /i "%Context%"=="Change.Folder.Icon" %Dir% &call :Config-Save &set "Context="&set "OpenFrom=Context" &cls &echo.&echo.&echo.&goto Intro
if /i "%Context%"=="Select.And.Change.Folder.Icon" set "InitDir=default"&set "FS-Trigger=Context"&set "FS-referer=Change.Folder.Icon"&goto FI-File_Selector
if /i "%Context%"=="Choose.from.collections" set "InitDir=Collect"&set "FS-Trigger=Context"&set "FS-referer=Change.Folder.Icon"&goto FI-File_Selector
if /i "%Context%"=="DIR.Choose.Template" set "refer=Choose.Template"&goto FI-Template
if /i "%Context%"=="FI.Search.Folder.Icon" goto FI-Search
if /i "%Context%"=="FI.Search.Poster" goto FI-Search
if /i "%Context%"=="FI.Search.Logo" goto FI-Search
if /i "%Context%"=="FI.Search.Icon" goto FI-Search
if /i "%Context%"=="FI.Search.Folder.Icon.Here" set "Context="&goto FI-Search
if /i "%Context%"=="Scan" set "input=Scan" &set "cdonly=true" &goto FI-Scan
if /i "%Context%"=="DefKey" goto FI-Keyword
if /i "%Context%"=="Move" set "cdonly=true"&goto FI-Move
if /i "%Context%"=="Rename" set "cdonly=true"&goto FI-Rename
if /i "%Context%"=="GenKey" set "input=Generate"&set "cdonly=true"&goto FI-Generate
if /i "%Context%"=="GenJPG" set "input=Generate"&set "OldKeywords=%Keywords%"&set "Keywords=.jpg"&call :VarUpdate&set "cdonly=true"&goto FI-Generate
if /i "%Context%"=="GenPNG" set "input=Generate"&set "OldKeywords=%Keywords%"&set "Keywords=.png"&call :VarUpdate&set "cdonly=true"&goto FI-Generate
if /i "%Context%"=="GenPosterJPG" set "input=Generate"&set "OldKeywords=%Keywords%"&set "Keywords=Poster.jpg" &call :VarUpdate&set "cdonly=true"&goto FI-Generate
if /i "%Context%"=="GenLandscapeJPG" set "input=Generate"&set "OldKeywords=%Keywords%"&set "Keywords=Landscape.jpg"&call :VarUpdate&set "cdonly=true"&goto FI-Generate
if /i "%Context%"=="ActivateFolderIcon" set "cdonly=true"&goto FI-Activate-Ask
if /i "%Context%"=="DeactivateFolderIcon" set "cdonly=true"&goto FI-Deactivate
if /i "%Context%"=="RemFolderIcon" set "delete=confirm"&set "cdonly=true" &goto FI-Remove
REM Background Dir
if /i "%Context%"=="DIRBG.Choose.Template" set "refer=Choose.Template" &goto FI-Template
if /i "%Context%"=="Scan.Here" %Dir% &set "input=Scan" &goto FI-Scan
if /i "%Context%"=="DefKey.Here" %DIR% &goto FI-Keyword
if /i "%Context%"=="GenKey.Here" %Dir% &set "input=Generate" &set "cdonly=false" &goto FI-Generate
if /i "%Context%"=="GenJPG.Here" %Dir% &set "input=Generate" &set "OldKeywords=%Keywords%"&set "Keywords=.jpg"&call :VarUpdate&set "cdonly=false" &goto FI-Generate
if /i "%Context%"=="GenPNG.Here" %Dir% &set "input=Generate" &set "OldKeywords=%Keywords%"&set "Keywords=.png"&call :VarUpdate&set "cdonly=false" &goto FI-Generate
if /i "%Context%"=="GenPosterJPG.Here" %Dir% &set "input=Generate" &set "OldKeywords=%Keywords%"&set "Keywords=Poster.jpg"&call :VarUpdate&set "cdonly=false" &goto FI-Generate
if /i "%Context%"=="Move.Here" %Dir% &goto FI-Move
if /i "%Context%"=="Rename.Here" %Dir% &goto FI-Rename
if /i "%Context%"=="GenLandscapeJPG.Here" %Dir% &set "input=Generate" &set "Keywords=Landscape.jpg"&call :VarUpdate&set "cdonly=false" &goto FI-Generate
if /i "%Context%"=="ActivateFolderIcon.Here" %Dir% &goto FI-Activate-Ask
if /i "%Context%"=="DeactivateFolderIcon.Here" %Dir% &goto FI-Deactivate
if /i "%Context%"=="RemFolderIcon.Here" %Dir% &set "delete=ask" &set "cdonly=false" &goto FI-Remove
if /i "%Context%"=="Edit.Config" start "" notepad.exe "%RCFI%\RCFI.config.ini"&exit
if /i "%Context%"=="Edit.Template" goto FI-Template-Edit
if /i "%Context%"=="More.Context" goto FI-More_Tools
REM Other
if /i "%Context%"=="FI.Deactivate" set "Setup=Deactivate" &goto Setup
goto Input-Error
:Input-Error
echo %TAB%%TAB%%R_% Invalid input. %_%
echo.
if defined Context echo %ESC%%TAB%%TAB%%I_%%R_%%Context%%_%
if not defined Context echo %ESC%%TAB%%TAB%%I_%%R_%%Command%%_%
echo.
echo %TAB%%G_%The command, file path, or directory path is unavailable.
rem echo %TAB%Use %GN_%Help%G_% to see available commands.
goto options
:FI-More_Tools
set "__= %GG_%"
set "_/_=%G_%/%GG_%"
set "_I_=%G_%^:"
PUSHD "%SelectedThing%"
set "Context="
echo %I_% %name% %version% %_%%-%
echo.
echo %__%Rcfi %_I_% Open RCFI Tools folder.
echo %__%Keyword%_/_%key %_I_% Set the keywords to search and select the image inside each folder.
echo %__%Scans%_/_%scs %_I_% Scan and check which image will be selected to generate the folder icon.
echo %__%Generates%_/_%gens %_I_% Generate folder icons on current directory including all subfolders ^(recursive^).
echo %__%Removes%_/_%rems %_I_% Remove all folder icons on current directory including all subfolders ^(recursive^).
echo %__%Renames%_/_%rens %_I_% Rename all icons on current directory including all subfolders ^(recursive^).
echo %__%Moves%_/_%movs %_I_% Move all icons on current directory including all subfolders ^(recursive^).
echo %__%Hide%_/_%hid %_I_% Hide/Unhide "desktop.ini" and "icon.ico" for all folders on current directory.
echo %__%Hides%_/_%hids %_I_% Hide/Unhide "desktop.ini" and "icon.ico" for all folders on current directory
echo including all subfolders ^(recursive^).
rem echo %__%FileHide%_/_%fhid %_I_% Hide/Unhide any files matching the keyword in all folders in current directory only.
rem echo %__%FileHides%_/_%fhids%_I_% Hide/Unhide any files matching the keyword in all folders including all subfolders ^(recursive^).
echo %__%Activate%_/_%act%G_% %_I_% Activate Folder Icon Tools.
echo %__%Deactivate%_/_%dct%G_% %_I_% Deactivate Folder Icon Tools.
echo.
echo %G_%Template:%ESC%%CC_%%TemplateName%%ESC% %G_%Keywords:%ESC%%KeywordsPrint%%ESC%
goto Options-Input
:DirectInput
set "cdonly=true"
PUSHD "%input%" 2>nul &&goto directInput-folder ||goto directInput-file
POPD&goto options
:DirectInput-Folder
PUSHD "%input%"
echo %TAB% Changing directory
echo %TAB%%ESC%%I_%%input%%-%
call :Config-Save
call :VarUpdate
goto options
:DirectInput-File
set "RefreshOpen=Select"
set "Selected="
for %%I in ("%input%") do (
set "filename=%%~nxI"
set "filepath=%%~dpI"
set "fileext=%%~xI"
for %%X in (%ImageSupport%) do if "%%X"=="%%~xI" goto DirectInput-Generate
)
echo %TAB%%R_%File type not supported.%-%
echo %TAB%%G_%^(supported file: %ImageSupport%^)
goto options
:DirectInput-Generate
for %%D in ("%cd%") do set "foldername=%%~nD%%~xD" &set "folderpath=%%~dpD"
set FolderDisplay=%TAB%%W_%%YY_s%┌%YY_%📁%ESC%%YY_%%foldername%%ESC%
if /i "%Direct%"=="Confirm" goto DirectInput-Generate-Confirm
if not exist desktop.ini goto DirectInput-Generate-Confirm
for /f "usebackq tokens=1,2 delims==" %%C in ("desktop.ini") do if not "%%D"=="" set "%%C=%%D"
if defined IconResource for %%I in ("%iconresource:"=%") do (
for /f "tokens=1,2 delims=," %%X in ("%%~xI") do set "IconResource=%%~dpnI%%X" & set "IconIndex=%%Y"
)
if not exist "%IconResource:"=%" goto DirectInput-Generate-Confirm
echo %TAB%%Y_%┌%Y_%📁%ESC%%W_%%foldername%%ESC%
echo %TAB%%Y_%└%Y_%🏞%ESC%%Y_%%IconResource:"=%%ESC%
attrib -s -h "%IconResource:"=%"
attrib |EXIT /B
echo %TAB%%G_% This folder already has a folder icon.
echo %TAB%%G_% Do you want to replace it%R_%^? %GN_%Y%_%/%GN_%N%bk_%
echo %TAB%%G_% Press %GG_%Y%G_% to confirm.%_%%bk_%
CHOICE /N /C YN
IF "%ERRORLEVEL%"=="2" (
echo %_%%TAB% %I_% Canceled %_%
Attrib %Attrib% "%IconResource:"=%"
attrib -|EXIT /B
goto options
)
IF "%ERRORLEVEL%"=="1" if defined Context cls &echo.&set "Direct=Confirm"&echo.&echo.&echo.
:DirectInput-Generate-Confirm
if exist "%IconResource:"=%" set "ReplaceThis=%IconResource:"=%"
attrib -s -h "%filepath%%filename%"
attrib |EXIT /B
call :timer-start
call :FI-Generate-Folder_Icon
goto options
:FI-File_Selector
set "FS-Disable=No"
set /a FS_Call+=1
if %FS_Call% EQU 1 (
if /i "%FileSelector%"=="no" set "FS-Disable=yes"
) else set "FS-Disable=no"
set "FS-BackToBackup="
set "FileSelectorPathBackup=%FileSelectorPath%"
if not exist "%FileSelectorPath%" set "FileSelectorPath=D:\"
rem due to xSelected quote stipped in Selected Folder when FolderCount is 1
if %xSelectedCount% EQU 1 if defined FolderCount PUSHD "%xSelected%"
if %xSelectedCount% EQU 1 if not defined FolderCount PUSHD %xSelected%
if %xSelectedCount% EQU 1 (set "FileSelectorPath=%cd%"&set "FS-BackToBackup=yes")
if exist "%FileSelector-defaultPath%" (
set "FileSelector-InitialPath=%FileSelector-defaultPath%"
) else (
set "FileSelector-InitialPath=%FileSelectorPath%"
)
if /i "%InitDir%"=="collect" (
set "initialDirectory=%CollectionsFolder%"
set "FS-BackToBackup=yes"
) else (
set "initialDirectory=%FileSelector-InitialPath%"
)
set "SaveSelectedFile=%RCFI%\resources\selected_file.txt"
set "fileFilter=Image Files (*.jpg, *.png, *.ico, ...)|%ImageFilter%"
set "OpenFileSelector=Add-Type -AssemblyName System.Windows.Forms; $f = New-Object System.Windows.Forms.OpenFileDialog; $f.InitialDirectory = '%initialDirectory%'; $fileDialog.RestoreDirectory = $true; $f.Multiselect = $true; $f.Filter = '%fileFilter%'; $f.ShowDialog() | Out-Null; $f.FileName; exit"
if /i not "%FS-referer%"=="cmd" if /i not "%FS-Disable%"=="yes" (
echo.&echo.&echo.&echo.&echo.&echo.&echo.&echo.&echo.&echo.
echo %I_%%G_% Select a file from the file selection dialog %_%
)
if /i not "%FS-Disable%"=="yes" start /MIN /WAIT "Select file" "%RCFI%\resources\File_Selector.bat"
if exist "%SaveSelectedFile%" (
for /f "usebackq tokens=* delims=" %%F in ("%SaveSelectedFile%") do (
set "SelectorSelectedFile=%%~fF"
set "FileSelectorPath=%%~dpF"
)
del /q "%SaveSelectedFile%" >nul
)
if /i "%SelectorSelectedFile%"==" " echo %TAB% %I_%%G_% No file selected %_%&echo.&echo.
if not exist "%SelectorSelectedFile%" (set "SelectorSelectedFile="&set "FS-BackToBackup=yes")
call :Config-Save
if /i "%FS-referer%"=="Change.Folder.Icon" (
if not defined SelectorSelectedFile cls
echo %-% & echo. & echo.
goto FI-Selected_folder
)
if /i "%FS-referer%"=="cmd" goto Input-Command
echo %-%&echo.&echo.&echo.
goto FI-Selected_folder
:FI-Selected_folder
set "input=_0"
set "cdonly=true"
set "context="
set "target=0.0"
set "replace="
set "Already="
del "%appdata%\RCFI Tools\replaceALL.RCFI" 2>nul
if not defined SFproceed call :FI-Selected_folder-Get
for %%S in (%xSelected%) do (
PUSHD "%%~fS" 2>nul &&for %%F in (%%S) do (
set "FolderPath=%%~fF"
set "FolderName=%%~nxF"
set "ReplaceThis="
if exist "desktop.ini" for /f "usebackq tokens=1,2 delims==" %%C in ("desktop.ini") do if not "%%D"=="" set "%%C=%%D"
call :FI-Selected_folder-input
POPD
)
)
set /a SFproceed+=1
echo.&echo.&echo.
goto FI-Selected_folder
:FI-Selected_folder-Get
echo %TAB%%I_% Change Folder Icon for Selected Folders. %_%
echo %TAB%%_%--------------------------------------------------------------------%_%
set /a FolderCount=0
set "referer=MultiFolderRightClick"
for %%S in (%xSelected%) do (
set "SelectedThing=%%~fS"
PUSHD "%%~fS" 2>nul &&(
set "location=%%~fS" &set "folderpath=%%~dpS" &set "foldername=%%~nxS"
call :FI-Scan-Desktop.ini
set /a FolderCount+=1
)
POPD
)
if %FolderCount% EQU 1 set "Context=Change.Folder.Icon"&set "xSelected=%SelectedThing%"&goto Input-Context
echo %TAB%%_%--------------------------------------------------------------------%_%
echo %TAB%%G_%Template:%ESC%%CC_%%TemplateName%%ESC%
echo.
EXIT /B
:FI-Selected_folder-Input
set "FS-referer="
set "FS-Trigger="
if not exist "%input%" (
echo %_%• %G_%%PP_%Drag and drop%_%%G_% an %C_%image%G_% into this window, then press Enter to change the folder icon.%_%
echo %_%• %G_%%G_%Press "%C_%O%G_%" and hit Enter to %C_%o%G_%pen the file selection dialog.%_%
echo %_%• %G_%%G_%Press "%C_%C%G_%" and hit Enter to open the %C_%C%G_%ollections.%_%
echo %G_%-------------------------------------------------------------------------------
if exist "%SelectorSelectedFile%" (
set "input=%SelectorSelectedFile%"
set "GeneratingCount=0"
set "SelectorSelectedFile="
echo %W_%Enter the image path:%_%%C_%"%SelectorSelectedFile%"
) else (
if exist "%RCFI%\resources\FolderUpdater_list.txt" %P2%&call :FI-Updater
set /p "Input=%_%%W_%Enter the image path:%_%%C_%"
set "GeneratingCount=0"
)
)
set "Input=%Input:"=%"
if /i "%input%"=="1" goto FI-Selected_folder-Separate
if /i "%input%"=="o" set "context=Select.And.Change.Folder.Icon"&goto Input-Context
if /i "%input%"=="c" set "context=Choose.from.collections"&goto Input-Context
echo.
if not exist "%Input%" (
echo.
echo.
echo %TAB% %_%Invalid path.
echo %TAB%%ESC%%R_%%I_%%input%%ESC%
echo %TAB% %G_%Make sure to enter a valid file path.%_%
echo.
echo.
goto FI-Selected_folder-input
)
set "RefreshOpen=Select"
set "Selected="
for %%I in ("%input%") do (set "filename=%%~nxI"&set "filepath=%%~dpI"&set "fileext=%%~xI")
for %%X in (%ImageSupport%) do (
if "%%X"=="%fileext%" (
call :FI-Selected_folder-Act
echo %G_%-------------------------------------------------------------------------------
set "iconresource="
EXIT /B
)
)
echo.
echo %TAB% %R_%File type not supported.%-%
echo %TAB% %G_%^(supported file: %ImageSupport%^)
echo.
set "input="
call :FI-Selected_folder-input
EXIT /B
:FI-Selected_folder-Act
if defined IconResource for %%I in ("%iconresource:"=%") do (
for /f "tokens=1,2 delims=," %%X in ("%%~xI") do set "IconResource=%%~dpnI%%X" & set "IconIndex=%%Y"
)
set FolderDisplay=%TAB%%W_%┌%YY_%📁%ESC%%YY_%%foldername%%ESC%
if not defined iconresource (
if not defined timestart call :Timer-start
call :FI-Generate-Folder_Icon
EXIT /B
) else if not exist "%IconResource:"=%" (
call :FI-Generate-Folder_Icon
EXIT /B
)
if /i "%replace%"=="all" (
set "ReplaceThis=%IconResource:"=%"
if not defined timestart call :Timer-start
call :FI-Generate-Folder_Icon
EXIT /B
)
if not exist "%IconResource:"=%" (
if not defined timestart call :Timer-start
call :FI-Generate-Folder_Icon
EXIT /B
)
echo %TAB%%Y_%┌%Y_%📁%ESC%%W_%%foldername%%ESC%
echo %TAB%%Y_%└%Y_%🏞%ESC%%Y_%%IconResource:"=%%ESC%
attrib -s -h "%IconResource:"=%"
attrib |EXIT /B
echo %TAB%%G_% This folder already has a folder icon.
echo %TAB%%G_% Do you want to replace it%R_%? %GN_%A%_%/%GN_%Y%_%/%GN_%N%bk_%
echo %TAB%%G_% Press %GG_%Y%G_% to confirm.%_%%G_% Press %GG_%A%G_% to confirm all.%bk_%
CHOICE /N /C AYN
IF "%ERRORLEVEL%"=="1" set "replace=all"
IF "%ERRORLEVEL%"=="3" (
echo %G_%%TAB% %I_% Skipped %_%
Attrib %Attrib% "%IconResource:"=%"
attrib -|EXIT /B
set "iconresource="
EXIT /B
)
set "ReplaceThis=%IconResource:"=%"
if not defined timestart call :Timer-start
call :FI-Generate-Folder_Icon
EXIT /B
:FI-Selected_folder-Separate
set "referer=MultiSelectFolder"
for %%S in (%xSelected%) do (
PUSHD "%%~fS" 2>nul &&(
start "" cmd.exe /c set "Context=Change.Folder.Icon"^&call "%~f0" "%%~fS"
)
POPD
)
exit
:FI-Scan
set "y_result=0"
set "g_result=0"
set "r_result=0"
set "h_result=0"
set "yy_result=0"
set "success_result=0"
set "fail_result=0"
set "Y_d=1"
set "G_d=1"
set "R_d=1"
set "YY_d=1"
set "Y_s="
set "G_s="
set "R_s="
set "YY_s="
set "Y_FolderDisplay="
set "G_FolderDisplay="
set "R_FolderDisplay="
set "YY_FolderDisplay="
echo %TAB%%TAB%%W_%%I_% Scanning Folders.. %-%
echo.
if /i "%recursive%"=="yes" echo %TAB%%U_%%W_%RECURSIVE MODE%_%
Echo %TAB%Keywords : %KeywordsPrint%
echo %TAB%Directory :%ESC%%cd%%ESC%
echo %TAB%%W_%==============================================================================%_%
call :timer-start
call :FI-GetDir
echo %TAB%%W_%==============================================================================%_%
set /a "result=%yy_result%+%y_result%+%g_result%+%r_result%"
set /a "FileMatchResult=%YY_result%+%R_result%"
set /a "hy_result=%yy_result%-%h_result%"
echo.
echo.
set "num=%result%" &call :Spaces
set "s=%__%" &set "num=%R_result%" &call :Spaces
set "R_s=%__%" &set "num=%Y_result%" &call :Spaces
set "Y_s=%__%" &set "num=%G_result%" &call :Spaces
set "G_s=%__%" &set "num=%YY_result%" &call :Spaces
set "YY_s=%__%" &set "num=%H_result%" &call :Spaces
set "H_s=%__%"
echo %TAB%%s%%U_%%result% Folders found.%_%
IF /i %YY_result% GTR 0 IF NOT %hy_result% EQU 0 echo %TAB%%YY_%%YY_s%%HY_result%%_% Folders can be processed.
IF /i %h_result% GTR 0 echo %TAB%%rr_%%H_s%%H_result%%_% Folders can't be processed.
IF /i %R_result% GTR 0 echo %TAB%%R_%%R_s%%R_result%%_% Folder's icons are missing and can be changed.
IF /i %Y_result% GTR 0 echo %TAB%%Y_%%Y_s%%Y_result%%_% Folders already have an icon.
IF /i %G_result% GTR 0 echo %TAB%%G_%%G_s%%G_result%%_% Folders have no files matching the keywords.
IF /i %FileMatchResult% LSS 1 echo %TAB%%R_% Couldn't find any files matching the keywords.%_%
echo.
set "result=0" &goto options
:FI-GetDir
set "locationCheck=Start"
set "StartDir=%CD%"
REM Current dir only
if /i "%cdonly%"=="true" (
FOR %%D in (%xSelected%) do (
title %name% %version% "%%~nxD"
set "location=%%~fD" &set "folderpath=%%~dpD" &set "foldername=%%~nxD"
PUSHD "%%~fD"
call :FI-Scan-Desktop.ini
POPD
)
EXIT /B
)
REM All inside current dir including subfolders
if /i "%Recursive%"=="yes" (
FOR /r %%D in (.) do (
title %name% %version% "%%~fD"
if /i not "%%~fD"=="%CD%" (
set "location=%%D" &set "folderpath=%%~dpD" &set "foldername=%%~fD"
PUSHD "%%D"
call :FI-Scan-Desktop.ini
POPD
)
)
EXIT /B
)
REM All inside current dir only
FOR /f "tokens=*" %%D in ('dir /b /a:d') do (
title %name% %version% "%%~nxD"
set "location=%%~fD" &set "folderpath=%%~dpD" &set "foldername=%%~nxD"
PUSHD "%%~fD"
call :FI-Scan-Desktop.ini
POPD
)
EXIT /B
:FI-GetDir-SubDir
set "SubDirSeparator=%W_%\%_%"
call set "FolderNameCD=%%Location:%CD%\=%%
title %name% %version% "%FolderNameCD%"
call set "FolderName=%%FolderNameCD:\=%SubDirSeparator%%%"
EXIT /B
:FI-Scan-Display_Result
if not defined Selected (
set "Selected=%Filename%"
echo %FolderDisplay%
echo %ESC%%W_%└%C_%🏞 %C_%%Filename%%ESC%
)
EXIT /B
:FI-Scan-Desktop.ini
if "%locationCheck%"=="%location%" EXIT /B
set "locationCheck=%location%" &set "Selected="
REM Get New Line
REM define new line
IF %Y_result% NEQ %Y_d% (set "Y_n=echo." ) else (set "Y_n=" )
IF %G_result% NEQ %G_d% (set "G_n=echo." ) else (set "G_n=" )
IF %R_result% NEQ %R_d% (set "R_n=echo." ) else (set "R_n=" )
IF %R_result% EQU %R_d% (set "R_nx=echo." ) else (set "R_nx=" )
IF %R_result% LSS %R_d% (set "R_nxx=echo." ) else (set "R_nxx=" )
IF %YY_result% NEQ %YY_d% (set "YY_n=echo." ) else (set "YY_n=" )
IF %YY_result% EQU %YY_d% (set "YY_nx=echo." ) else (set "YY_nx=" )
IF %YY_result% LSS %YY_d% (set "YY_nxx=echo.") else (set "YY_nxx=")
if /i "%referer%"=="MultiFolderRightClick" (
set "Y_n="
set "G_n="
set "R_n="
set "R_nx="
set "R_nxx="
set "YY_n="
set "YY_nx="
set "YY_nxx="
)
REM display number correction +1
IF %Y_result% EQU %Y_d% set /a "Y_d+=1"
IF %G_result% EQU %G_d% set /a "G_d+=1"
IF %R_result% EQU %R_d% set /a "R_d+=1"
IF %YY_result% EQU %YY_d% set /a "YY_d+=1"
REM Showing Number
REM display number indentation so all can be aligned.
REM IF %Y_d% LSS 10 (set "Y_s= %Y_d%")
REM IF %G_d% LSS 10 (set "G_s= %G_d%")
REM IF %R_d% LSS 10 (set "R_s= %R_d%")
REM IF %YY_d% LSS 10 (set "YY_s= %YY_d%")
REM
REM IF %Y_d% GTR 9 (set "Y_s= %Y_d%")
REM IF %G_d% GTR 9 (set "G_s= %G_d%")
REM IF %R_d% GTR 9 (set "R_s= %R_d%")
REM IF %YY_d% GTR 9 (set "YY_s= %YY_d%")
REM
REM IF %Y_d% GTR 99 (set "Y_s=%Y_d%")
REM IF %G_d% GTR 99 (set "G_s=%G_d%")
REM IF %R_d% GTR 99 (set "R_s=%R_d%")
REM IF %YY_d% GTR 99 (set "YY_s=%YY_d%")
REM Display folder name
set Y_FolderDisplay=%TAB%%Y_%%Y_s%📁%ESC%%_%%foldername%%ESC%
set G_FolderDisplay=%TAB%%G_%%G_s%📁%ESC%%_%%foldername%%ESC%
set R_FolderDisplay=%TAB%%W_%%R_s%┌%RR_%📁%ESC%%YY_%%foldername%%ESC%
set YY_FolderDisplay=%TAB%%W_%%YY_s%┌%YY_%📁%ESC%%YY_%%foldername%%ESC%
if /i "%recursive%"=="yes" call :FI-Scan-Desktop.ini-Recursive
if /i "%referer%"=="MultiFolderRightClick" (
set R_FolderDisplay=%TAB%%W_%%R_s%%RR_%📁%ESC%%_%%foldername%%ESC%
set YY_FolderDisplay=%TAB%%W_%%YY_s%%YY_%📁%ESC%%_%%foldername%%ESC%
)
set "IconResource="
if exist "desktop.ini" for /f "usebackq tokens=1,2 delims==" %%C in ("desktop.ini") do if not "%%D"=="" set "%%C=%%D"
if defined IconResource for %%I in ("%iconresource:"=%") do (
for /f "tokens=1,2 delims=," %%X in ("%%~xI") do set "IconResource=%%~dpnI%%X" & set "IconIndex=%%Y"
)
if not defined IconResource (
for %%F in (%KeywordsFind%) do (
for %%X in (%ImageSupport%) do (
if /i "%%X"=="%%~xF" (
if exist "desktop.ini" (
REM "Access denied" if I put it up there, idk why?
attrib -s -h "desktop.ini"
attrib |EXIT /B
copy "desktop.ini" "desktop.backup.ini" 2>nul
Attrib %Attrib% "desktop.ini"
Attrib %Attrib% "desktop.backup.ini"
attrib |EXIT /B
)
%YY_n%
set FolderDisplay=%YY_FolderDisplay%
if /i "%referer%"=="MultiFolderRightClick" echo %YY_FolderDisplay%
set /a YY_result+=1
set "FileName=%%~nxF"
set "FilePath=%%~dpF"
set "FileExt=%%~xF"
if /i "%input:"=%"=="Scan" call :FI-Scan-Display_Result
if /i "%input:"=%"=="Generate" call :FI-Generate-Folder_Icon
%YY_nx%
%YY_nxx%
EXIT /B
)
)
)
REM %G_n%
echo %G_FolderDisplay%
set /a G_result+=1
set "newline=yes"
EXIT /B
)
if exist "desktop.ini" if not exist "%IconResource:"=%" (
for %%F in (%KeywordsFind%) do (
for %%X in (%ImageSupport%) do (
if /i "%%X"=="%%~xF" (
%R_n%
set FolderDisplay=%R_FolderDisplay%
if /i "%referer%"=="MultiFolderRightClick" echo %R_FolderDisplay%
set /a R_result+=1
if /i not "%referer%"=="MultiFolderRightClick" (
set "MissingIconResource=Found"
)
set "newline=no"
set "Filename=%%~nxF"
set "FilePath=%%~dpF"
set "FileExt=%%~xF"
if /i "%input%"=="Scan" call :FI-Scan-Display_Result
if /i "%input%"=="Generate" call :FI-Generate-Folder_Icon
set "iconresource="
%R_nx%
%R_nxx%
EXIT /B
)
)
)
REM %G_n%
echo %G_FolderDisplay%
set /a G_result+=1
EXIT /B
)
if exist "desktop.ini" if exist "%IconResource:"=%" (
REM %Y_n%
echo %Y_FolderDisplay%
set /a Y_result+=1
)
set "iconresource="
if /i "%Context%"=="Create" (
for %%F in (%KeywordsFind%) do (echo.&echo.&echo %R_%%TAB% Something when wrong^?. :/ &pause>nul)
)
EXIT /B
:FI-Scan-Desktop.ini-Recursive
call set "FolderName=%%Location:%StartDir%\=%%
if /i "%FolderName:~-2%"=="\." set "FolderName=%FolderName:~0,-2%"
call set "Y_FolderName=%%FolderName:\=%W_%\%_%%%"
call set "G_FolderName=%%FolderName:\=%W_%\%_%%%"
call set "R_FolderName=%%FolderName:\=%W_%\%R_%%%"
call set "YY_FolderName=%%FolderName:\=%W_%\%YY_%%%"
set Y_FolderDisplay=%TAB%%Y_%%Y_s%📁%ESC%%_%%Y_foldername%%ESC%
set G_FolderDisplay=%TAB%%G_%%G_s%📁%ESC%%_%%G_foldername%%ESC%
set R_FolderDisplay=%TAB%%W_%%R_s%┌%YY_%📁%ESC%%YY_%%R_foldername%%ESC%
set YY_FolderDisplay=%TAB%%W_%%YY_s%┌%YY_%📁%ESC%%YY_%%YY_foldername%%ESC%
EXIT /B
:FI-Generate
set "referer="
set "yy_result=0"
set "y_result=0"
set "g_result=0"
set "r_result=0"
set "h_result=0"
set "Y_d=1"
set "G_d=1"
set "R_d=1"
set "YY_d=1"
set "Y_s="
set "G_s="
set "R_s="
set "YY_s="
set "success_result=0"
set "fail_result=0"
echo %TAB%%TAB%%I_%%CC_% Generating folder icon.. %-%
echo.
if /i "%recursive%"=="yes" echo %TAB%%U_%%W_%RECURSIVE MODE%_%
echo %TAB%Keyword :%ESC%%KeywordsPrint%%ESC%
if exist "%Template%" (
for %%T in ("%Template%") do (
echo %TAB%Template :%ESC%%CC_%%%~nT%ESC%
)
) else (
echo %TAB%Template :%ESC% %CC_%^?%ESC%
set "TemplateAlwaysAsk=yes"
)
echo %TAB%Directory :%ESC%%cd%%ESC%
echo %TAB%%W_%==============================================================================%_%
call :timer-start
call :FI-GetDir
echo %TAB%%W_%==============================================================================%_%
set /a "result=%yy_result%+%y_result%+%g_result%+%r_result%"
set /a "action_result=%r_result%+%success_result%+%fail_result%"
if /i "%cdonly%"=="true" if %success_result% EQU 1 goto options
if /i "%cdonly%"=="true" if %result% EQU 1 if %y_result% EQU 1 (
echo.&echo.&echo.
echo %TAB%%ESC%%Y_%📁 %foldername%%ESC%
echo.
echo %TAB%%W_%Folder already has an icon.
echo %TAB%Remove it first.%_%
echo.&echo.&echo.
)
if /i "%cdonly%"=="true" if %result% EQU 1 if %g_result% EQU 1 (
echo.&echo.&echo.
echo %TAB%%ESC%%G_%📁 %foldername%%ESC%
echo.
echo %TAB%%W_%Couldn't find any files matching the keywords.
echo.&echo.&echo.
)