Expected result of the script:
For each drive/partition that contains the extensionless file nosleep in its root, execute the command pushd %drvLetter% dir /b /s > tempdata.txt every 5 minutes, non-stop on all found drives.
Incompleted Sample Script:
The following is something similar to what I'm trying to do but can't finish it because it is beyond my current knowledge. Added some REM comments that explains some stuff.
Code: Select all
REM Set all found drives in a variable
for /f %%a in (c d e f g h i j k l n m o p q r s t u v w x y z) do (
if exist %%a:\nosleep (
set dev=%%a:
)
)
REM loop through each found drive letter in the variable and then loop indefinetaly the same command every 5 min on that drive.
:loop
for /f "delims=;" %%a in (%dev%) do (
pushd %dev%
ping 127.0.0.1 -n 300 > nul
dir /b /s > tempdata.txt
goto loop
)
Thank you for your time and patience.