fork download
  1. your text goes here@echo off
  2.  
  3. setlocal EnableDelayedExpansion
  4. set oldpath=%cd%
  5.  
  6. set "toFind=%1"
  7. set "strtMsg=Started Searching in Drive"
  8. set "endMsg=Done Searching in Drive"
  9. set "alphabet=ABCDEFGHIJKLMNOPQRSTUVWXYZ"
  10.  
  11. for /L %%a in (0,1,25) do (
  12.  
  13. rem retrieve letter : it expands alphabet variable using '!'
  14. rem then uses slicing operator '~' to slice (start,size) -> (%%a, 1)
  15. rem this gets only one char at crnt index of for loop!
  16. set crntDrive=!alphabet:~%%a,1!
  17.  
  18. if exist !crntDrive!: (
  19.  
  20. cd /d !crntDrive!:
  21.  
  22. echo.
  23. echo  ===================================================================
  24. echo  = %strtMsg%'!crntDrive!' =
  25. echo  ===================================================================
  26. echo.
  27.  
  28. dir "\*%toFind%" /a /s
  29.  
  30. echo.
  31. echo  ===================================================================
  32. echo  = %endMsg%'!crntDrive!' =
  33. echo  ===================================================================
  34. echo.
  35.  
  36. )
  37.  
  38.  
  39. )
  40.  
  41. cd /d %oldpath%
  42. endlocal
Not running #stdin #stdout 0s 0KB
stdin
Standard input is empty
stdout
Standard output is empty