Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ```bat
- @echo off
- setlocal EnableDelayedExpansion
- set "base=%~dp0"
- set /a count=0
- rem Считаем папки
- for /d %%D in ("%base%*") do (
- set /a count+=1
- set "folder[!count!]=%%~fD"
- )
- rem Проверяем, есть ли папки
- if %count%==0 (
- echo В текущей папке нет подпапок.
- pause
- exit /b
- )
- rem Выбираем случайную папку
- set /a random=%random% %% count + 1
- rem Открываем её
- explorer "!folder[%random%]!"
- endlocal
- ```
Advertisement
Add Comment
Please, Sign In to add comment