automation-lib 5.10.5 → 5.10.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +41 -44
- package/dist/index.d.ts +41 -44
- package/docs.txt +2 -2
- package/package.json +1 -1
- package/read-file-path.bat +81 -81
package/dist/index.d.mts
CHANGED
|
@@ -11559,17 +11559,11 @@ interface FilterManagerSheetDto extends IFilterBaseDto {
|
|
|
11559
11559
|
interface CreateSheetToolDto {
|
|
11560
11560
|
type: ESheetToolInstagram;
|
|
11561
11561
|
typeSocial: ETypeSocial;
|
|
11562
|
-
url: string;
|
|
11563
|
-
name: string;
|
|
11564
|
-
deviceId: string;
|
|
11565
|
-
description: string;
|
|
11566
|
-
timeCrawl: ESheetToolTimeCrawl;
|
|
11567
|
-
totalRows: number;
|
|
11568
|
-
totalCols: number;
|
|
11569
|
-
}
|
|
11570
|
-
interface PayloadUrlSheetToolDto extends Partial<ISheetsTool> {
|
|
11571
11562
|
sheetUrl: string;
|
|
11572
11563
|
sheetName: string;
|
|
11564
|
+
deviceId: string;
|
|
11565
|
+
timeCrawl: ESheetToolTimeCrawl;
|
|
11566
|
+
description: string;
|
|
11573
11567
|
}
|
|
11574
11568
|
interface LoadInfoUrlSheetToolDto {
|
|
11575
11569
|
idea: string;
|
|
@@ -11578,8 +11572,10 @@ interface LoadInfoUrlSheetToolDto {
|
|
|
11578
11572
|
accountGroup: string[];
|
|
11579
11573
|
listAccountIds: string[];
|
|
11580
11574
|
listAccountUsername: string[];
|
|
11581
|
-
|
|
11582
|
-
|
|
11575
|
+
}
|
|
11576
|
+
interface PayloadUrlSheetToolDto extends Partial<ISheetsTool> {
|
|
11577
|
+
sheetUrl: string;
|
|
11578
|
+
sheetName: string;
|
|
11583
11579
|
}
|
|
11584
11580
|
interface ActionLoadInfoUrlSheetToolDto {
|
|
11585
11581
|
typeSocial: ETypeSocial;
|
|
@@ -11624,34 +11620,13 @@ interface OverviewSheetsToolDto {
|
|
|
11624
11620
|
totalReplyMessenger: number;
|
|
11625
11621
|
}
|
|
11626
11622
|
interface FindSheetsToolDto extends IFindBaseDto {
|
|
11627
|
-
typeSocial: ETypeSocial;
|
|
11628
|
-
idea: {
|
|
11629
|
-
id: string;
|
|
11630
|
-
name: string;
|
|
11631
|
-
};
|
|
11632
|
-
niche: {
|
|
11633
|
-
id: string;
|
|
11634
|
-
name: string;
|
|
11635
|
-
};
|
|
11636
|
-
type: ETypeManagerWorkClassify;
|
|
11637
|
-
device: {
|
|
11638
|
-
id: string;
|
|
11639
|
-
name: string;
|
|
11640
|
-
statusConnectPC: EStatusDeviceConnectPC;
|
|
11641
|
-
};
|
|
11642
11623
|
pc: {
|
|
11643
11624
|
id: string;
|
|
11644
11625
|
name: string;
|
|
11645
11626
|
};
|
|
11646
|
-
|
|
11647
|
-
|
|
11648
|
-
typeSheet: ESheetToolInstagram;
|
|
11627
|
+
deviceID: string;
|
|
11628
|
+
statusDevice: EStatusDeviceConnectPC;
|
|
11649
11629
|
statusImport: ESheetToolStatusImport;
|
|
11650
|
-
statusRun: ESheetToolStatusRun;
|
|
11651
|
-
timeCrawl: ESheetToolTimeCrawl;
|
|
11652
|
-
totalRows: number;
|
|
11653
|
-
totalCols: number;
|
|
11654
|
-
description: string;
|
|
11655
11630
|
listAccountSocial: Array<{
|
|
11656
11631
|
id: string;
|
|
11657
11632
|
accountId: string;
|
|
@@ -11660,6 +11635,28 @@ interface FindSheetsToolDto extends IFindBaseDto {
|
|
|
11660
11635
|
status: string;
|
|
11661
11636
|
createdAt: Date;
|
|
11662
11637
|
}>;
|
|
11638
|
+
statusRun: ESheetToolStatusRun;
|
|
11639
|
+
typeSheet: ESheetToolInstagram;
|
|
11640
|
+
timeReadingSheet: number;
|
|
11641
|
+
sheetName: string;
|
|
11642
|
+
sheetUrl: string;
|
|
11643
|
+
totalCols: number;
|
|
11644
|
+
totalRows: number;
|
|
11645
|
+
timeCrawl: ESheetToolTimeCrawl;
|
|
11646
|
+
statusCrawl: EStatusActive;
|
|
11647
|
+
description: string;
|
|
11648
|
+
typeSocial: ETypeSocial;
|
|
11649
|
+
idea: {
|
|
11650
|
+
id: string;
|
|
11651
|
+
name: string;
|
|
11652
|
+
};
|
|
11653
|
+
niche: {
|
|
11654
|
+
id: string;
|
|
11655
|
+
name: string;
|
|
11656
|
+
};
|
|
11657
|
+
type: ETypeManagerWorkClassify;
|
|
11658
|
+
url: string;
|
|
11659
|
+
name: string;
|
|
11663
11660
|
noteFixImport: string;
|
|
11664
11661
|
lastUserInfo: IUserInfoAssignment;
|
|
11665
11662
|
}
|
|
@@ -12217,7 +12214,7 @@ interface ImageVideoVoiceDetailInstagramDto {
|
|
|
12217
12214
|
typeIdea: ETypeManagerWorkClassify;
|
|
12218
12215
|
createdAt: Date;
|
|
12219
12216
|
updatedAt: Date;
|
|
12220
|
-
toolAuto:
|
|
12217
|
+
toolAuto: 'Browser Automation';
|
|
12221
12218
|
taskToolKeyAiGen: string;
|
|
12222
12219
|
statusImageVideoVoice: ETaskStatus;
|
|
12223
12220
|
currentStepImageVideoVoice: number;
|
|
@@ -12253,7 +12250,7 @@ interface ImageVideoVoiceDetailInstagramDto {
|
|
|
12253
12250
|
}>;
|
|
12254
12251
|
infoBrowserInfo: {
|
|
12255
12252
|
browserName: string;
|
|
12256
|
-
browserType:
|
|
12253
|
+
browserType: 'GPM';
|
|
12257
12254
|
listProxy: Array<{
|
|
12258
12255
|
proxyFormat: string;
|
|
12259
12256
|
proxyType: ETypeProxy;
|
|
@@ -12275,7 +12272,7 @@ interface ImageVideoVoiceDetailInstagramDto {
|
|
|
12275
12272
|
}>;
|
|
12276
12273
|
infoGenVoice: {
|
|
12277
12274
|
model: string;
|
|
12278
|
-
modeVoice:
|
|
12275
|
+
modeVoice: 'Multi Speaker Audio';
|
|
12279
12276
|
modelSetting: string;
|
|
12280
12277
|
language: string;
|
|
12281
12278
|
totalVoice: number;
|
|
@@ -12314,11 +12311,11 @@ interface ImageVideoVoiceDetailInstagramDto {
|
|
|
12314
12311
|
urlFolderDrive: string;
|
|
12315
12312
|
result: Array<{
|
|
12316
12313
|
timestamp: Date;
|
|
12317
|
-
typeTask:
|
|
12314
|
+
typeTask: 'Image' | 'Video';
|
|
12318
12315
|
taskName: string;
|
|
12319
12316
|
status: string;
|
|
12320
12317
|
timeGenerate: number;
|
|
12321
|
-
typeAction:
|
|
12318
|
+
typeAction: 'Tool' | 'Api';
|
|
12322
12319
|
message: string;
|
|
12323
12320
|
}>;
|
|
12324
12321
|
};
|
|
@@ -12334,7 +12331,7 @@ interface CanvaDetailInstagramDto {
|
|
|
12334
12331
|
typeIdea: ETypeManagerWorkClassify;
|
|
12335
12332
|
createdAt: Date;
|
|
12336
12333
|
updatedAt: Date;
|
|
12337
|
-
toolAuto:
|
|
12334
|
+
toolAuto: 'Canva';
|
|
12338
12335
|
taskToolKeyCanva: string;
|
|
12339
12336
|
currentStepCanva: number;
|
|
12340
12337
|
totalStepCanva: number;
|
|
@@ -12363,7 +12360,7 @@ interface CanvaDetailInstagramDto {
|
|
|
12363
12360
|
}>;
|
|
12364
12361
|
infoBrowserInfo: {
|
|
12365
12362
|
browserName: string;
|
|
12366
|
-
browserType:
|
|
12363
|
+
browserType: 'GPM';
|
|
12367
12364
|
listProxy: Array<{
|
|
12368
12365
|
proxyFormat: string;
|
|
12369
12366
|
proxyType: ETypeProxy;
|
|
@@ -12394,7 +12391,7 @@ interface CanvaDetailInstagramDto {
|
|
|
12394
12391
|
effectPage27: string;
|
|
12395
12392
|
};
|
|
12396
12393
|
infoCanvaEditPage: Array<{
|
|
12397
|
-
page:
|
|
12394
|
+
page: 'Page1' | 'Page2' | 'Page3' | 'Page4' | 'Page5' | 'Page6' | 'Page7';
|
|
12398
12395
|
status: ETaskStatus;
|
|
12399
12396
|
time: number;
|
|
12400
12397
|
retry: number;
|
|
@@ -12428,8 +12425,8 @@ interface CanvaDetailInstagramDto {
|
|
|
12428
12425
|
result: Array<{
|
|
12429
12426
|
timestamp: Date;
|
|
12430
12427
|
status: ETaskStatus;
|
|
12431
|
-
typeAction:
|
|
12432
|
-
page:
|
|
12428
|
+
typeAction: 'Edit';
|
|
12429
|
+
page: 'Page1' | 'Page2' | 'Page3' | 'Page4' | 'Page5' | 'Page6' | 'Page7';
|
|
12433
12430
|
background: string;
|
|
12434
12431
|
frontText: string;
|
|
12435
12432
|
effect: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -11559,17 +11559,11 @@ interface FilterManagerSheetDto extends IFilterBaseDto {
|
|
|
11559
11559
|
interface CreateSheetToolDto {
|
|
11560
11560
|
type: ESheetToolInstagram;
|
|
11561
11561
|
typeSocial: ETypeSocial;
|
|
11562
|
-
url: string;
|
|
11563
|
-
name: string;
|
|
11564
|
-
deviceId: string;
|
|
11565
|
-
description: string;
|
|
11566
|
-
timeCrawl: ESheetToolTimeCrawl;
|
|
11567
|
-
totalRows: number;
|
|
11568
|
-
totalCols: number;
|
|
11569
|
-
}
|
|
11570
|
-
interface PayloadUrlSheetToolDto extends Partial<ISheetsTool> {
|
|
11571
11562
|
sheetUrl: string;
|
|
11572
11563
|
sheetName: string;
|
|
11564
|
+
deviceId: string;
|
|
11565
|
+
timeCrawl: ESheetToolTimeCrawl;
|
|
11566
|
+
description: string;
|
|
11573
11567
|
}
|
|
11574
11568
|
interface LoadInfoUrlSheetToolDto {
|
|
11575
11569
|
idea: string;
|
|
@@ -11578,8 +11572,10 @@ interface LoadInfoUrlSheetToolDto {
|
|
|
11578
11572
|
accountGroup: string[];
|
|
11579
11573
|
listAccountIds: string[];
|
|
11580
11574
|
listAccountUsername: string[];
|
|
11581
|
-
|
|
11582
|
-
|
|
11575
|
+
}
|
|
11576
|
+
interface PayloadUrlSheetToolDto extends Partial<ISheetsTool> {
|
|
11577
|
+
sheetUrl: string;
|
|
11578
|
+
sheetName: string;
|
|
11583
11579
|
}
|
|
11584
11580
|
interface ActionLoadInfoUrlSheetToolDto {
|
|
11585
11581
|
typeSocial: ETypeSocial;
|
|
@@ -11624,34 +11620,13 @@ interface OverviewSheetsToolDto {
|
|
|
11624
11620
|
totalReplyMessenger: number;
|
|
11625
11621
|
}
|
|
11626
11622
|
interface FindSheetsToolDto extends IFindBaseDto {
|
|
11627
|
-
typeSocial: ETypeSocial;
|
|
11628
|
-
idea: {
|
|
11629
|
-
id: string;
|
|
11630
|
-
name: string;
|
|
11631
|
-
};
|
|
11632
|
-
niche: {
|
|
11633
|
-
id: string;
|
|
11634
|
-
name: string;
|
|
11635
|
-
};
|
|
11636
|
-
type: ETypeManagerWorkClassify;
|
|
11637
|
-
device: {
|
|
11638
|
-
id: string;
|
|
11639
|
-
name: string;
|
|
11640
|
-
statusConnectPC: EStatusDeviceConnectPC;
|
|
11641
|
-
};
|
|
11642
11623
|
pc: {
|
|
11643
11624
|
id: string;
|
|
11644
11625
|
name: string;
|
|
11645
11626
|
};
|
|
11646
|
-
|
|
11647
|
-
|
|
11648
|
-
typeSheet: ESheetToolInstagram;
|
|
11627
|
+
deviceID: string;
|
|
11628
|
+
statusDevice: EStatusDeviceConnectPC;
|
|
11649
11629
|
statusImport: ESheetToolStatusImport;
|
|
11650
|
-
statusRun: ESheetToolStatusRun;
|
|
11651
|
-
timeCrawl: ESheetToolTimeCrawl;
|
|
11652
|
-
totalRows: number;
|
|
11653
|
-
totalCols: number;
|
|
11654
|
-
description: string;
|
|
11655
11630
|
listAccountSocial: Array<{
|
|
11656
11631
|
id: string;
|
|
11657
11632
|
accountId: string;
|
|
@@ -11660,6 +11635,28 @@ interface FindSheetsToolDto extends IFindBaseDto {
|
|
|
11660
11635
|
status: string;
|
|
11661
11636
|
createdAt: Date;
|
|
11662
11637
|
}>;
|
|
11638
|
+
statusRun: ESheetToolStatusRun;
|
|
11639
|
+
typeSheet: ESheetToolInstagram;
|
|
11640
|
+
timeReadingSheet: number;
|
|
11641
|
+
sheetName: string;
|
|
11642
|
+
sheetUrl: string;
|
|
11643
|
+
totalCols: number;
|
|
11644
|
+
totalRows: number;
|
|
11645
|
+
timeCrawl: ESheetToolTimeCrawl;
|
|
11646
|
+
statusCrawl: EStatusActive;
|
|
11647
|
+
description: string;
|
|
11648
|
+
typeSocial: ETypeSocial;
|
|
11649
|
+
idea: {
|
|
11650
|
+
id: string;
|
|
11651
|
+
name: string;
|
|
11652
|
+
};
|
|
11653
|
+
niche: {
|
|
11654
|
+
id: string;
|
|
11655
|
+
name: string;
|
|
11656
|
+
};
|
|
11657
|
+
type: ETypeManagerWorkClassify;
|
|
11658
|
+
url: string;
|
|
11659
|
+
name: string;
|
|
11663
11660
|
noteFixImport: string;
|
|
11664
11661
|
lastUserInfo: IUserInfoAssignment;
|
|
11665
11662
|
}
|
|
@@ -12217,7 +12214,7 @@ interface ImageVideoVoiceDetailInstagramDto {
|
|
|
12217
12214
|
typeIdea: ETypeManagerWorkClassify;
|
|
12218
12215
|
createdAt: Date;
|
|
12219
12216
|
updatedAt: Date;
|
|
12220
|
-
toolAuto:
|
|
12217
|
+
toolAuto: 'Browser Automation';
|
|
12221
12218
|
taskToolKeyAiGen: string;
|
|
12222
12219
|
statusImageVideoVoice: ETaskStatus;
|
|
12223
12220
|
currentStepImageVideoVoice: number;
|
|
@@ -12253,7 +12250,7 @@ interface ImageVideoVoiceDetailInstagramDto {
|
|
|
12253
12250
|
}>;
|
|
12254
12251
|
infoBrowserInfo: {
|
|
12255
12252
|
browserName: string;
|
|
12256
|
-
browserType:
|
|
12253
|
+
browserType: 'GPM';
|
|
12257
12254
|
listProxy: Array<{
|
|
12258
12255
|
proxyFormat: string;
|
|
12259
12256
|
proxyType: ETypeProxy;
|
|
@@ -12275,7 +12272,7 @@ interface ImageVideoVoiceDetailInstagramDto {
|
|
|
12275
12272
|
}>;
|
|
12276
12273
|
infoGenVoice: {
|
|
12277
12274
|
model: string;
|
|
12278
|
-
modeVoice:
|
|
12275
|
+
modeVoice: 'Multi Speaker Audio';
|
|
12279
12276
|
modelSetting: string;
|
|
12280
12277
|
language: string;
|
|
12281
12278
|
totalVoice: number;
|
|
@@ -12314,11 +12311,11 @@ interface ImageVideoVoiceDetailInstagramDto {
|
|
|
12314
12311
|
urlFolderDrive: string;
|
|
12315
12312
|
result: Array<{
|
|
12316
12313
|
timestamp: Date;
|
|
12317
|
-
typeTask:
|
|
12314
|
+
typeTask: 'Image' | 'Video';
|
|
12318
12315
|
taskName: string;
|
|
12319
12316
|
status: string;
|
|
12320
12317
|
timeGenerate: number;
|
|
12321
|
-
typeAction:
|
|
12318
|
+
typeAction: 'Tool' | 'Api';
|
|
12322
12319
|
message: string;
|
|
12323
12320
|
}>;
|
|
12324
12321
|
};
|
|
@@ -12334,7 +12331,7 @@ interface CanvaDetailInstagramDto {
|
|
|
12334
12331
|
typeIdea: ETypeManagerWorkClassify;
|
|
12335
12332
|
createdAt: Date;
|
|
12336
12333
|
updatedAt: Date;
|
|
12337
|
-
toolAuto:
|
|
12334
|
+
toolAuto: 'Canva';
|
|
12338
12335
|
taskToolKeyCanva: string;
|
|
12339
12336
|
currentStepCanva: number;
|
|
12340
12337
|
totalStepCanva: number;
|
|
@@ -12363,7 +12360,7 @@ interface CanvaDetailInstagramDto {
|
|
|
12363
12360
|
}>;
|
|
12364
12361
|
infoBrowserInfo: {
|
|
12365
12362
|
browserName: string;
|
|
12366
|
-
browserType:
|
|
12363
|
+
browserType: 'GPM';
|
|
12367
12364
|
listProxy: Array<{
|
|
12368
12365
|
proxyFormat: string;
|
|
12369
12366
|
proxyType: ETypeProxy;
|
|
@@ -12394,7 +12391,7 @@ interface CanvaDetailInstagramDto {
|
|
|
12394
12391
|
effectPage27: string;
|
|
12395
12392
|
};
|
|
12396
12393
|
infoCanvaEditPage: Array<{
|
|
12397
|
-
page:
|
|
12394
|
+
page: 'Page1' | 'Page2' | 'Page3' | 'Page4' | 'Page5' | 'Page6' | 'Page7';
|
|
12398
12395
|
status: ETaskStatus;
|
|
12399
12396
|
time: number;
|
|
12400
12397
|
retry: number;
|
|
@@ -12428,8 +12425,8 @@ interface CanvaDetailInstagramDto {
|
|
|
12428
12425
|
result: Array<{
|
|
12429
12426
|
timestamp: Date;
|
|
12430
12427
|
status: ETaskStatus;
|
|
12431
|
-
typeAction:
|
|
12432
|
-
page:
|
|
12428
|
+
typeAction: 'Edit';
|
|
12429
|
+
page: 'Page1' | 'Page2' | 'Page3' | 'Page4' | 'Page5' | 'Page6' | 'Page7';
|
|
12433
12430
|
background: string;
|
|
12434
12431
|
frontText: string;
|
|
12435
12432
|
effect: string;
|
package/docs.txt
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
############ Cấu hình npm ############
|
|
1
|
+
|
|
2
|
+
############ Cấu hình npm ############
|
|
3
3
|
npm config set //registry.npmjs.org/:_authToken {token}
|
package/package.json
CHANGED
package/read-file-path.bat
CHANGED
|
@@ -1,81 +1,81 @@
|
|
|
1
|
-
@echo off
|
|
2
|
-
setlocal enabledelayedexpansion
|
|
3
|
-
chcp 65001 >nul
|
|
4
|
-
echo ====================================
|
|
5
|
-
echo FILE SEARCH AND LIST UTILITY
|
|
6
|
-
echo ====================================
|
|
7
|
-
echo.
|
|
8
|
-
|
|
9
|
-
set /p folder_path="Enter folder path: "
|
|
10
|
-
|
|
11
|
-
if not exist "%folder_path%" (
|
|
12
|
-
echo.
|
|
13
|
-
echo [ERROR] Folder does not exist!
|
|
14
|
-
pause
|
|
15
|
-
exit /b
|
|
16
|
-
)
|
|
17
|
-
|
|
18
|
-
echo.
|
|
19
|
-
set /p file_pattern="Enter file name pattern (press Enter to list all files): "
|
|
20
|
-
|
|
21
|
-
if "%file_pattern%"=="" (
|
|
22
|
-
set search_mode=ALL_FILES
|
|
23
|
-
set output_file=all_files_%date:~10,4%%date:~4,2%%date:~7,2%_%time:~0,2%%time:~3,2%%time:~6,2%.txt
|
|
24
|
-
) else (
|
|
25
|
-
set search_mode=PATTERN_SEARCH
|
|
26
|
-
set output_file=search_%file_pattern:_=_%_%date:~10,4%%date:~4,2%%date:~7,2%_%time:~0,2%%time:~3,2%%time:~6,2%.txt
|
|
27
|
-
)
|
|
28
|
-
|
|
29
|
-
set output_file=%output_file: =0%
|
|
30
|
-
|
|
31
|
-
echo.
|
|
32
|
-
echo Searching files...
|
|
33
|
-
if "%search_mode%"=="PATTERN_SEARCH" (
|
|
34
|
-
echo Pattern: *%file_pattern%*
|
|
35
|
-
) else (
|
|
36
|
-
echo Listing all files...
|
|
37
|
-
)
|
|
38
|
-
echo.
|
|
39
|
-
|
|
40
|
-
echo ============ SEARCH RESULTS ============ > "%output_file%"
|
|
41
|
-
echo Folder: %folder_path% >> "%output_file%"
|
|
42
|
-
echo Time: %date% %time% >> "%output_file%"
|
|
43
|
-
if "%search_mode%"=="PATTERN_SEARCH" (
|
|
44
|
-
echo Search Pattern: *%file_pattern%* >> "%output_file%"
|
|
45
|
-
) else (
|
|
46
|
-
echo Search Mode: All Files >> "%output_file%"
|
|
47
|
-
)
|
|
48
|
-
echo ====================================== >> "%output_file%"
|
|
49
|
-
echo. >> "%output_file%"
|
|
50
|
-
|
|
51
|
-
set count=0
|
|
52
|
-
|
|
53
|
-
if "%search_mode%"=="ALL_FILES" (
|
|
54
|
-
for /r "%folder_path%" %%f in (*) do (
|
|
55
|
-
echo %%f
|
|
56
|
-
echo %%f >> "%output_file%"
|
|
57
|
-
set /a count+=1
|
|
58
|
-
)
|
|
59
|
-
) else (
|
|
60
|
-
for /r "%folder_path%" %%f in (*) do (
|
|
61
|
-
echo %%~nxf | findstr /i "%file_pattern%" >nul
|
|
62
|
-
if !errorlevel! equ 0 (
|
|
63
|
-
echo %%f
|
|
64
|
-
echo %%f >> "%output_file%"
|
|
65
|
-
set /a count+=1
|
|
66
|
-
)
|
|
67
|
-
)
|
|
68
|
-
)
|
|
69
|
-
|
|
70
|
-
echo.
|
|
71
|
-
echo ====================================
|
|
72
|
-
if "%search_mode%"=="PATTERN_SEARCH" (
|
|
73
|
-
echo Total matching files: %count%
|
|
74
|
-
) else (
|
|
75
|
-
echo Total files: %count%
|
|
76
|
-
)
|
|
77
|
-
echo Result saved to: %output_file%
|
|
78
|
-
echo ====================================
|
|
79
|
-
echo.
|
|
80
|
-
|
|
81
|
-
pause
|
|
1
|
+
@echo off
|
|
2
|
+
setlocal enabledelayedexpansion
|
|
3
|
+
chcp 65001 >nul
|
|
4
|
+
echo ====================================
|
|
5
|
+
echo FILE SEARCH AND LIST UTILITY
|
|
6
|
+
echo ====================================
|
|
7
|
+
echo.
|
|
8
|
+
|
|
9
|
+
set /p folder_path="Enter folder path: "
|
|
10
|
+
|
|
11
|
+
if not exist "%folder_path%" (
|
|
12
|
+
echo.
|
|
13
|
+
echo [ERROR] Folder does not exist!
|
|
14
|
+
pause
|
|
15
|
+
exit /b
|
|
16
|
+
)
|
|
17
|
+
|
|
18
|
+
echo.
|
|
19
|
+
set /p file_pattern="Enter file name pattern (press Enter to list all files): "
|
|
20
|
+
|
|
21
|
+
if "%file_pattern%"=="" (
|
|
22
|
+
set search_mode=ALL_FILES
|
|
23
|
+
set output_file=all_files_%date:~10,4%%date:~4,2%%date:~7,2%_%time:~0,2%%time:~3,2%%time:~6,2%.txt
|
|
24
|
+
) else (
|
|
25
|
+
set search_mode=PATTERN_SEARCH
|
|
26
|
+
set output_file=search_%file_pattern:_=_%_%date:~10,4%%date:~4,2%%date:~7,2%_%time:~0,2%%time:~3,2%%time:~6,2%.txt
|
|
27
|
+
)
|
|
28
|
+
|
|
29
|
+
set output_file=%output_file: =0%
|
|
30
|
+
|
|
31
|
+
echo.
|
|
32
|
+
echo Searching files...
|
|
33
|
+
if "%search_mode%"=="PATTERN_SEARCH" (
|
|
34
|
+
echo Pattern: *%file_pattern%*
|
|
35
|
+
) else (
|
|
36
|
+
echo Listing all files...
|
|
37
|
+
)
|
|
38
|
+
echo.
|
|
39
|
+
|
|
40
|
+
echo ============ SEARCH RESULTS ============ > "%output_file%"
|
|
41
|
+
echo Folder: %folder_path% >> "%output_file%"
|
|
42
|
+
echo Time: %date% %time% >> "%output_file%"
|
|
43
|
+
if "%search_mode%"=="PATTERN_SEARCH" (
|
|
44
|
+
echo Search Pattern: *%file_pattern%* >> "%output_file%"
|
|
45
|
+
) else (
|
|
46
|
+
echo Search Mode: All Files >> "%output_file%"
|
|
47
|
+
)
|
|
48
|
+
echo ====================================== >> "%output_file%"
|
|
49
|
+
echo. >> "%output_file%"
|
|
50
|
+
|
|
51
|
+
set count=0
|
|
52
|
+
|
|
53
|
+
if "%search_mode%"=="ALL_FILES" (
|
|
54
|
+
for /r "%folder_path%" %%f in (*) do (
|
|
55
|
+
echo %%f
|
|
56
|
+
echo %%f >> "%output_file%"
|
|
57
|
+
set /a count+=1
|
|
58
|
+
)
|
|
59
|
+
) else (
|
|
60
|
+
for /r "%folder_path%" %%f in (*) do (
|
|
61
|
+
echo %%~nxf | findstr /i "%file_pattern%" >nul
|
|
62
|
+
if !errorlevel! equ 0 (
|
|
63
|
+
echo %%f
|
|
64
|
+
echo %%f >> "%output_file%"
|
|
65
|
+
set /a count+=1
|
|
66
|
+
)
|
|
67
|
+
)
|
|
68
|
+
)
|
|
69
|
+
|
|
70
|
+
echo.
|
|
71
|
+
echo ====================================
|
|
72
|
+
if "%search_mode%"=="PATTERN_SEARCH" (
|
|
73
|
+
echo Total matching files: %count%
|
|
74
|
+
) else (
|
|
75
|
+
echo Total files: %count%
|
|
76
|
+
)
|
|
77
|
+
echo Result saved to: %output_file%
|
|
78
|
+
echo ====================================
|
|
79
|
+
echo.
|
|
80
|
+
|
|
81
|
+
pause
|