automation-lib 6.6.1 → 6.6.3

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/commit.bat CHANGED
@@ -7,12 +7,10 @@ git add .
7
7
  echo Committing changes...
8
8
  set /p commit_message="Enter commit message: "
9
9
  git commit -m "%commit_message%"
10
- timeout /t 2 /nobreak >nul
10
+ sleep 2
11
11
 
12
12
  :: Push changes to the 'main' branch of the 'cp' remote
13
- git pull hs toan
14
- timeout /t 2 /nobreak >nul
15
- git pull hs main
13
+ git pull origin toan
16
14
 
17
15
  :: Read the current version from package.json
18
16
  for /f "tokens=2 delims=:, " %%i in ('findstr "version" package.json') do set currentVersion=%%i
@@ -43,10 +41,10 @@ echo New version: %newVersion%
43
41
  call npm run pub
44
42
 
45
43
  git add .
46
- timeout /t 1 /nobreak >nul
44
+ sleep 1
47
45
  git commit -m "%commit_message%"
48
- timeout /t 2 /nobreak >nul
46
+ sleep 2
49
47
 
50
- git push hs main
48
+ git push origin toan
51
49
 
52
50
 
package/dist/index.d.mts CHANGED
@@ -1,3 +1,5 @@
1
+ import { ESheetToolInstagram as ESheetToolInstagram$1 } from 'automation-lib';
2
+
1
3
  declare const CONST_API_OTP: {
2
4
  SEND: string;
3
5
  CONFIRM: string;
@@ -154,6 +156,7 @@ declare const CONST_API_CONTROLLERS: {
154
156
  TASKS_IMAGE_VOICE_CANVA_THREADS: string;
155
157
  TASKS_IMAGE_VOICE_CANVA_INSTAGRAM: string;
156
158
  TASKS_AVATAR_COVER_CANVA_INSTAGRAM: string;
159
+ TASKS_AVATAR_COVER_CANVA_STEP_INSTAGRAM: string;
157
160
  };
158
161
  INSTAGRAM: {
159
162
  POST: string;
@@ -15238,6 +15241,7 @@ interface FindTaskAIAvatarCoverCanvaInstagramDto extends IFindBaseDto {
15238
15241
  sheetID: string;
15239
15242
  sheetUrl: string;
15240
15243
  sheetName: string;
15244
+ sheetType: ESheetToolInstagram$1;
15241
15245
  rowID: string;
15242
15246
  pcName: string;
15243
15247
  pcAlias: string;
@@ -16616,12 +16620,6 @@ declare enum ETaskWorkflowNodeCategory {
16616
16620
  LogicAndSupport = "LogicAndSupport"
16617
16621
  }
16618
16622
 
16619
- declare enum ETaskWorkflowRunStatus {
16620
- Success = "Success",
16621
- Fail = "Fail",
16622
- Running = "Running"
16623
- }
16624
-
16625
16623
  declare enum ETaskWorkflowNodeInstagram {
16626
16624
  TaskSocialAutoPosts = "TaskSocialAutoPosts",// Kích hoạt khi bài post mới hoàn thành (In: 0, Out: 1)
16627
16625
  EgoCheck = "EgoCheck",// Kiểm tra trang cá nhân, story, grid
@@ -16668,61 +16666,11 @@ declare enum ETaskWorkflowNodeInstagram {
16668
16666
  SettingConfigHumanDelay = "SettingConfigHumanDelay"
16669
16667
  }
16670
16668
 
16671
- declare enum ETaskWorkflowNodeThreads {
16672
- EgoCheck = "EgoCheck",// Tự xem bài viết đang lên (Ego Check)
16673
- CrossPromoStory = "CrossPromoStory",// Share bài lên Story (Cross-Promo)
16674
- DoomedScrollingReels = "DoomedScrollingReels",// Lướt Reels vô định (Doomed Scrolling)
16675
- FomoCheck = "FomoCheck",// Check thông báo (Fomo)
16676
- NewsFeedScroll = "NewsFeedScroll",// Lướt Newsfeed (Dạo)
16677
- ViewFriendStory = "ViewFriendStory",// Xem Story bạn bè
16678
- RandomLike = "RandomLike",// Like bài viết (Random)
16679
- ContextComment = "ContextComment",// Comment AI (Context)
16680
- HumanPause = "HumanPause",// Nghỉ ngơi
16681
- Delay = "Delay",// Delay thời gian
16682
- Condition = "Condition",// Điều kiện
16683
- RandomChance = "RandomChance",// Điều kiện rẽ nhánh theo tỉ lệ phần trăm
16684
- Note = "Note",// Ghi chú
16685
- End = "End"
16686
- }
16687
-
16688
- interface CreateTaskWorkflowDto {
16689
- }
16690
- interface UpdateTaskWorkflowDto {
16691
- }
16692
- interface FindTaskWorkflowDto extends IFindBaseDto {
16693
- typeSocial: ETypeSocial;
16694
- name: string;
16695
- description: string;
16696
- status: ETaskWorkflowStatus;
16697
- group: string;
16698
- numberNode: number;
16699
- numberStep: number;
16700
- numberAccount: number;
16701
- logs: {
16702
- success: number;
16703
- fail: number;
16704
- running: number;
16705
- };
16706
- }
16707
- interface FilterTaskWorkflowDto {
16708
- }
16709
-
16710
- interface CreateTaskWorkflowGroupDto {
16711
- name: string;
16712
- description: string;
16713
- }
16714
- interface UpdateTaskWorkflowGroupDto {
16715
- name?: string;
16716
- description?: string;
16717
- }
16718
- interface FindTaskWorkflowGroupDto extends IFindBaseDto {
16719
- name: string;
16720
- description: string;
16721
- }
16722
-
16723
16669
  interface ITaskWorkflowGroup extends IBaseModel, ITrackingModel {
16724
16670
  name: string;
16725
16671
  description: string;
16672
+ color: string;
16673
+ typeSocial: ETypeSocial;
16726
16674
  }
16727
16675
 
16728
16676
  interface ITaskWorkflow extends IBaseModel, ITrackingModel {
@@ -16754,6 +16702,23 @@ interface ITaskWorkflowNodeInstagram extends IBaseModel, ITrackingModel {
16754
16702
  attributes: ITaskWorkflowNodeInstagramAttribute;
16755
16703
  }
16756
16704
 
16705
+ declare enum ETaskWorkflowNodeThreads {
16706
+ EgoCheck = "EgoCheck",// Tự xem bài viết đang lên (Ego Check)
16707
+ CrossPromoStory = "CrossPromoStory",// Share bài lên Story (Cross-Promo)
16708
+ DoomedScrollingReels = "DoomedScrollingReels",// Lướt Reels vô định (Doomed Scrolling)
16709
+ FomoCheck = "FomoCheck",// Check thông báo (Fomo)
16710
+ NewsFeedScroll = "NewsFeedScroll",// Lướt Newsfeed (Dạo)
16711
+ ViewFriendStory = "ViewFriendStory",// Xem Story bạn bè
16712
+ RandomLike = "RandomLike",// Like bài viết (Random)
16713
+ ContextComment = "ContextComment",// Comment AI (Context)
16714
+ HumanPause = "HumanPause",// Nghỉ ngơi
16715
+ Delay = "Delay",// Delay thời gian
16716
+ Condition = "Condition",// Điều kiện
16717
+ RandomChance = "RandomChance",// Điều kiện rẽ nhánh theo tỉ lệ phần trăm
16718
+ Note = "Note",// Ghi chú
16719
+ End = "End"
16720
+ }
16721
+
16757
16722
  interface ITaskWorkflowNodeThreadsAttribute {
16758
16723
  }
16759
16724
 
@@ -16767,12 +16732,64 @@ interface ITaskWorkflowNodeThreads extends IBaseModel, ITrackingModel {
16767
16732
  attributes: ITaskWorkflowNodeThreadsAttribute;
16768
16733
  }
16769
16734
 
16735
+ declare enum ETaskWorkflowRunStatus {
16736
+ Success = "Success",
16737
+ Fail = "Fail",
16738
+ Running = "Running"
16739
+ }
16740
+
16770
16741
  interface ITaskWorkflowLog extends IBaseModel, ITrackingModel {
16771
16742
  typeSocial: ETypeSocial;
16772
16743
  accountSocialId: string;
16773
16744
  statusRun: ETaskWorkflowRunStatus;
16774
16745
  }
16775
16746
 
16747
+ interface CreateTaskWorkflowDto {
16748
+ group: string;
16749
+ name: string;
16750
+ description: string;
16751
+ status: ETaskWorkflowStatus;
16752
+ typeSocial: ETypeSocial;
16753
+ }
16754
+ interface UpdateTaskWorkflowDto extends CreateTaskWorkflowDto {
16755
+ }
16756
+ interface FindTaskWorkflowDto extends IFindBaseDto {
16757
+ typeSocial: ETypeSocial;
16758
+ name: string;
16759
+ description: string;
16760
+ status: ETaskWorkflowStatus;
16761
+ group: string | ITaskWorkflowGroup;
16762
+ numberNode: number;
16763
+ numberStep: number;
16764
+ numberAccount: number;
16765
+ logs: {
16766
+ success: number;
16767
+ fail: number;
16768
+ running: number;
16769
+ };
16770
+ }
16771
+ interface FilterTaskWorkflowDto {
16772
+ }
16773
+
16774
+ interface CreateTaskWorkflowGroupDto {
16775
+ name: string;
16776
+ description: string;
16777
+ color: string;
16778
+ typeSocial: ETypeSocial;
16779
+ }
16780
+ interface UpdateTaskWorkflowGroupDto {
16781
+ name?: string;
16782
+ description?: string;
16783
+ color: string;
16784
+ typeSocial: ETypeSocial;
16785
+ }
16786
+ interface FindTaskWorkflowGroupDto extends IFindBaseDto {
16787
+ name: string;
16788
+ description: string;
16789
+ color: string;
16790
+ typeSocial: ETypeSocial;
16791
+ }
16792
+
16776
16793
  interface IVoiceLanguage extends IBaseModel, ITrackingModel {
16777
16794
  vl_name: string;
16778
16795
  vl_key: ETypeVoiceLanguage;
package/dist/index.d.ts CHANGED
@@ -1,3 +1,5 @@
1
+ import { ESheetToolInstagram as ESheetToolInstagram$1 } from 'automation-lib';
2
+
1
3
  declare const CONST_API_OTP: {
2
4
  SEND: string;
3
5
  CONFIRM: string;
@@ -154,6 +156,7 @@ declare const CONST_API_CONTROLLERS: {
154
156
  TASKS_IMAGE_VOICE_CANVA_THREADS: string;
155
157
  TASKS_IMAGE_VOICE_CANVA_INSTAGRAM: string;
156
158
  TASKS_AVATAR_COVER_CANVA_INSTAGRAM: string;
159
+ TASKS_AVATAR_COVER_CANVA_STEP_INSTAGRAM: string;
157
160
  };
158
161
  INSTAGRAM: {
159
162
  POST: string;
@@ -15238,6 +15241,7 @@ interface FindTaskAIAvatarCoverCanvaInstagramDto extends IFindBaseDto {
15238
15241
  sheetID: string;
15239
15242
  sheetUrl: string;
15240
15243
  sheetName: string;
15244
+ sheetType: ESheetToolInstagram$1;
15241
15245
  rowID: string;
15242
15246
  pcName: string;
15243
15247
  pcAlias: string;
@@ -16616,12 +16620,6 @@ declare enum ETaskWorkflowNodeCategory {
16616
16620
  LogicAndSupport = "LogicAndSupport"
16617
16621
  }
16618
16622
 
16619
- declare enum ETaskWorkflowRunStatus {
16620
- Success = "Success",
16621
- Fail = "Fail",
16622
- Running = "Running"
16623
- }
16624
-
16625
16623
  declare enum ETaskWorkflowNodeInstagram {
16626
16624
  TaskSocialAutoPosts = "TaskSocialAutoPosts",// Kích hoạt khi bài post mới hoàn thành (In: 0, Out: 1)
16627
16625
  EgoCheck = "EgoCheck",// Kiểm tra trang cá nhân, story, grid
@@ -16668,61 +16666,11 @@ declare enum ETaskWorkflowNodeInstagram {
16668
16666
  SettingConfigHumanDelay = "SettingConfigHumanDelay"
16669
16667
  }
16670
16668
 
16671
- declare enum ETaskWorkflowNodeThreads {
16672
- EgoCheck = "EgoCheck",// Tự xem bài viết đang lên (Ego Check)
16673
- CrossPromoStory = "CrossPromoStory",// Share bài lên Story (Cross-Promo)
16674
- DoomedScrollingReels = "DoomedScrollingReels",// Lướt Reels vô định (Doomed Scrolling)
16675
- FomoCheck = "FomoCheck",// Check thông báo (Fomo)
16676
- NewsFeedScroll = "NewsFeedScroll",// Lướt Newsfeed (Dạo)
16677
- ViewFriendStory = "ViewFriendStory",// Xem Story bạn bè
16678
- RandomLike = "RandomLike",// Like bài viết (Random)
16679
- ContextComment = "ContextComment",// Comment AI (Context)
16680
- HumanPause = "HumanPause",// Nghỉ ngơi
16681
- Delay = "Delay",// Delay thời gian
16682
- Condition = "Condition",// Điều kiện
16683
- RandomChance = "RandomChance",// Điều kiện rẽ nhánh theo tỉ lệ phần trăm
16684
- Note = "Note",// Ghi chú
16685
- End = "End"
16686
- }
16687
-
16688
- interface CreateTaskWorkflowDto {
16689
- }
16690
- interface UpdateTaskWorkflowDto {
16691
- }
16692
- interface FindTaskWorkflowDto extends IFindBaseDto {
16693
- typeSocial: ETypeSocial;
16694
- name: string;
16695
- description: string;
16696
- status: ETaskWorkflowStatus;
16697
- group: string;
16698
- numberNode: number;
16699
- numberStep: number;
16700
- numberAccount: number;
16701
- logs: {
16702
- success: number;
16703
- fail: number;
16704
- running: number;
16705
- };
16706
- }
16707
- interface FilterTaskWorkflowDto {
16708
- }
16709
-
16710
- interface CreateTaskWorkflowGroupDto {
16711
- name: string;
16712
- description: string;
16713
- }
16714
- interface UpdateTaskWorkflowGroupDto {
16715
- name?: string;
16716
- description?: string;
16717
- }
16718
- interface FindTaskWorkflowGroupDto extends IFindBaseDto {
16719
- name: string;
16720
- description: string;
16721
- }
16722
-
16723
16669
  interface ITaskWorkflowGroup extends IBaseModel, ITrackingModel {
16724
16670
  name: string;
16725
16671
  description: string;
16672
+ color: string;
16673
+ typeSocial: ETypeSocial;
16726
16674
  }
16727
16675
 
16728
16676
  interface ITaskWorkflow extends IBaseModel, ITrackingModel {
@@ -16754,6 +16702,23 @@ interface ITaskWorkflowNodeInstagram extends IBaseModel, ITrackingModel {
16754
16702
  attributes: ITaskWorkflowNodeInstagramAttribute;
16755
16703
  }
16756
16704
 
16705
+ declare enum ETaskWorkflowNodeThreads {
16706
+ EgoCheck = "EgoCheck",// Tự xem bài viết đang lên (Ego Check)
16707
+ CrossPromoStory = "CrossPromoStory",// Share bài lên Story (Cross-Promo)
16708
+ DoomedScrollingReels = "DoomedScrollingReels",// Lướt Reels vô định (Doomed Scrolling)
16709
+ FomoCheck = "FomoCheck",// Check thông báo (Fomo)
16710
+ NewsFeedScroll = "NewsFeedScroll",// Lướt Newsfeed (Dạo)
16711
+ ViewFriendStory = "ViewFriendStory",// Xem Story bạn bè
16712
+ RandomLike = "RandomLike",// Like bài viết (Random)
16713
+ ContextComment = "ContextComment",// Comment AI (Context)
16714
+ HumanPause = "HumanPause",// Nghỉ ngơi
16715
+ Delay = "Delay",// Delay thời gian
16716
+ Condition = "Condition",// Điều kiện
16717
+ RandomChance = "RandomChance",// Điều kiện rẽ nhánh theo tỉ lệ phần trăm
16718
+ Note = "Note",// Ghi chú
16719
+ End = "End"
16720
+ }
16721
+
16757
16722
  interface ITaskWorkflowNodeThreadsAttribute {
16758
16723
  }
16759
16724
 
@@ -16767,12 +16732,64 @@ interface ITaskWorkflowNodeThreads extends IBaseModel, ITrackingModel {
16767
16732
  attributes: ITaskWorkflowNodeThreadsAttribute;
16768
16733
  }
16769
16734
 
16735
+ declare enum ETaskWorkflowRunStatus {
16736
+ Success = "Success",
16737
+ Fail = "Fail",
16738
+ Running = "Running"
16739
+ }
16740
+
16770
16741
  interface ITaskWorkflowLog extends IBaseModel, ITrackingModel {
16771
16742
  typeSocial: ETypeSocial;
16772
16743
  accountSocialId: string;
16773
16744
  statusRun: ETaskWorkflowRunStatus;
16774
16745
  }
16775
16746
 
16747
+ interface CreateTaskWorkflowDto {
16748
+ group: string;
16749
+ name: string;
16750
+ description: string;
16751
+ status: ETaskWorkflowStatus;
16752
+ typeSocial: ETypeSocial;
16753
+ }
16754
+ interface UpdateTaskWorkflowDto extends CreateTaskWorkflowDto {
16755
+ }
16756
+ interface FindTaskWorkflowDto extends IFindBaseDto {
16757
+ typeSocial: ETypeSocial;
16758
+ name: string;
16759
+ description: string;
16760
+ status: ETaskWorkflowStatus;
16761
+ group: string | ITaskWorkflowGroup;
16762
+ numberNode: number;
16763
+ numberStep: number;
16764
+ numberAccount: number;
16765
+ logs: {
16766
+ success: number;
16767
+ fail: number;
16768
+ running: number;
16769
+ };
16770
+ }
16771
+ interface FilterTaskWorkflowDto {
16772
+ }
16773
+
16774
+ interface CreateTaskWorkflowGroupDto {
16775
+ name: string;
16776
+ description: string;
16777
+ color: string;
16778
+ typeSocial: ETypeSocial;
16779
+ }
16780
+ interface UpdateTaskWorkflowGroupDto {
16781
+ name?: string;
16782
+ description?: string;
16783
+ color: string;
16784
+ typeSocial: ETypeSocial;
16785
+ }
16786
+ interface FindTaskWorkflowGroupDto extends IFindBaseDto {
16787
+ name: string;
16788
+ description: string;
16789
+ color: string;
16790
+ typeSocial: ETypeSocial;
16791
+ }
16792
+
16776
16793
  interface IVoiceLanguage extends IBaseModel, ITrackingModel {
16777
16794
  vl_name: string;
16778
16795
  vl_key: ETypeVoiceLanguage;
package/dist/index.js CHANGED
@@ -420,7 +420,8 @@ var CONST_API_CONTROLLERS = {
420
420
  TASKS_IMAGE_CANVA_INSTAGRAM: "tasks-image-canva-instagram",
421
421
  TASKS_IMAGE_VOICE_CANVA_THREADS: "tasks-image-voice-canva-threads",
422
422
  TASKS_IMAGE_VOICE_CANVA_INSTAGRAM: "tasks-image-voice-canva-instagram",
423
- TASKS_AVATAR_COVER_CANVA_INSTAGRAM: "tasks-avatar-cover-canva-instagram"
423
+ TASKS_AVATAR_COVER_CANVA_INSTAGRAM: "tasks-avatar-cover-canva-instagram",
424
+ TASKS_AVATAR_COVER_CANVA_STEP_INSTAGRAM: "tasks-avartar-cover-canva-step-instagram"
424
425
  },
425
426
  INSTAGRAM: {
426
427
  POST: "instagram-task-post",
package/dist/index.mjs CHANGED
@@ -179,7 +179,8 @@ var CONST_API_CONTROLLERS = {
179
179
  TASKS_IMAGE_CANVA_INSTAGRAM: "tasks-image-canva-instagram",
180
180
  TASKS_IMAGE_VOICE_CANVA_THREADS: "tasks-image-voice-canva-threads",
181
181
  TASKS_IMAGE_VOICE_CANVA_INSTAGRAM: "tasks-image-voice-canva-instagram",
182
- TASKS_AVATAR_COVER_CANVA_INSTAGRAM: "tasks-avatar-cover-canva-instagram"
182
+ TASKS_AVATAR_COVER_CANVA_INSTAGRAM: "tasks-avatar-cover-canva-instagram",
183
+ TASKS_AVATAR_COVER_CANVA_STEP_INSTAGRAM: "tasks-avartar-cover-canva-step-instagram"
183
184
  },
184
185
  INSTAGRAM: {
185
186
  POST: "instagram-task-post",
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "automation-lib",
3
- "version": "6.6.1",
3
+ "version": "6.6.3",
4
4
  "description": "Common features and type of applications auto",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
@@ -1,81 +1,81 @@
1
- n@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
+ n@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