Advertisement
Najeebsk

RUN-FILES-COM.bat

May 2nd, 2023
1,520
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 4.07 KB | None | 0 0
  1. @shift /0
  2. @ECHO OFF
  3. TITLE ~~~*** NAJEEB FILES CREATE RENAME AND MORE ***~~~
  4. COLOR 1B
  5. setlocal enabledelayedexpansion
  6. Mode con cols=75 lines=18
  7. :home
  8. ECHO                    ~~~*** NAJEEB SHAH KHAN FILES COMMANDS ***~~~
  9. ECHO                           %TIME%  %DATE%
  10. ECHO  -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  11. ECHO.
  12. echo                 0) Najeeb Commands
  13. echo                 1) File Extension Change
  14. echo                 2) File Rename Numerical Numbers
  15. echo                 3) Delete Lines That Contains Word
  16. echo                 4) Find Lines That Contains Word Save
  17. echo                 5) Create Multiple Folders
  18. echo                 6) Create Multiple Files
  19. echo                 7) Create Number List Files
  20. echo.
  21. set /p web=TYPE OPTION:
  22. if "%web%"=="0" goto nsk
  23. if "%web%"=="1" goto ext
  24. if "%web%"=="2" goto ren
  25. if "%web%"=="3" goto tex
  26. if "%web%"=="4" goto fin
  27. if "%web%"=="5" goto fol
  28. if "%web%"=="6" goto fil
  29. if "%web%"=="7" goto lis
  30. pause:
  31. set /p MT= Type GO TO Here:
  32. Pause:
  33. CALL GOTO %MT%
  34. ::============================NSK COMMANDS==============================
  35. :nsk
  36. cls
  37. ECHO                  ~~~*** NAJEEB SHAH KHAN CMD COMMANDS***~~~
  38. echo                           %TIME%  %DATE%
  39. echo  =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  40. ECHO    ~**Most Commonly Used Internal and External DOS Commands Exmple**~
  41. ECHO.
  42. Echo    TYPE:COMMANDS (Type COM.ini)
  43. Echo    ATTRIB,CALL,CD,COPY,CLS,CLIP,DATE,DEL,DIR,EDIT,
  44. Echo    ERASE,EXIT,FIND,FINDSTR,FOR,FORMAT,HELP,IF,
  45. Echo    MD,MKDIR,MOVE,PATH,PAUSE,RD,RMDIR,REN,RENAME,
  46. Echo    SET,SORT,TIME,TREE,TYPE,UNDELETE,VER,VOL,WMIC
  47. ECHO.
  48. set /P "input=Command: "
  49. cls
  50. call %input%
  51. ECHO.
  52. pause:
  53. goto home
  54. ::============================Extension=======================
  55. :ext
  56. set /p input= Original File Type Change Extension Only =
  57. set /p input2= Type Change Extension Only =
  58. ren *.%input% *.%input2%
  59. Pause:
  60. goto home
  61. ::============================Rename========================
  62. :ren
  63. set /p start=Please Enter The Starting Control Number:
  64. set /p ALP=Please Enter Alphabet :
  65. set /p EXT=Please Enter Extension :
  66. setlocal enableDelayedExpansion
  67.  
  68. for /r %%g in (*.%EXT%) do (call :RenameIt %%g)
  69. goto :eof
  70. goto :exit
  71.  
  72. :RenameIt
  73. echo Renaming "%~nx1" to !start!%~x1
  74. ren "%~nx1" %ALP%!start!%~x1
  75. set /a start+=1
  76. goto :eof
  77.  
  78. :exit
  79. exit /b
  80. ::=========================Delete Word======================
  81. :tex      
  82. SET /P TEXT= ENTER WORD REMOVE :
  83. SET /P FILE= ENTER FILE NAME :
  84. FindStr /V "%TEXT%" %FILE%>OUTPUT.txt
  85. PAUSE :
  86. START OUTPUT.txt
  87. goto home
  88. ::=========================Find Save Word====================
  89. :fin
  90. SET /P TEXT= ENTER WORD FIND :
  91. SET /P FILE= ENTER FILE NAME :
  92. FindStr  "%TEXT%" %FILE%>OUTPUT.txt
  93. PAUSE :
  94. START OUTPUT.txt
  95. goto home
  96. ::===================Create Multiple Folders=====================
  97. :fol
  98. set /P "text=Enter A Folder Name: "
  99.  
  100. :PromptNumber
  101. set /P "number=How Many Create Folders Number: "
  102. set /A N=number 2>nul
  103. if %N% LSS  1 goto PrintError
  104. if %N% GTR 99 goto PrintError
  105.  
  106. echo/
  107. for /L %%g in (1,1,%N%) do (md %text%-%%g)
  108. echo/
  109. pause
  110. goto :EOF
  111.  
  112. :PrintError
  113. echo/
  114. echo Check your number which must be between 1 and 100.
  115. echo/
  116. goto PromptNumber
  117. goto home
  118. ::======================Create Multiple Files====================
  119. :fil
  120. set /P "text=Enter A File Name: "
  121.  
  122. :PromptNumber
  123. set /P "number=How Many Create Files Number: "
  124. set /A N=number 2>nul
  125. if %N% LSS  1 goto PrintError
  126. if %N% GTR 99 goto PrintError
  127.  
  128. echo/
  129. for /L %%I in (1,1,%N%) do echo Create "%text%-%%I.txt" 2>"%text%-%%I.txt"
  130. echo/
  131. pause
  132. goto :EOF
  133.  
  134. :PrintError
  135. echo/
  136. echo Check your number which must be between 1 and 100.
  137. echo/
  138. goto PromptNumber
  139. goto home
  140. ::===================Create Number List Files===================
  141. :lis
  142. SET /P uname=Please Enter (File Name Or Path Or Word):
  143. SET /P ext=Please Enter Extension:
  144. SET /P count=How Many Lines Number:
  145. FOR /L %%G IN (1,1,%count%) DO ECHO %uname%%%G.%ext% >>File-List.txt
  146. IF "%uname%"=="" GOTO Error
  147. pause
  148. GOTO End
  149. :Error
  150. ECHO You did not enter your name! Bye bye!!
  151. goto home
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement