Skip to content

Commit 9595492

Browse files
authored
1.0.2
1 parent 932e92e commit 9595492

1 file changed

Lines changed: 63 additions & 2 deletions

File tree

PathScan.bat

Lines changed: 63 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ title PathScan
1212
::: | |_/ /_ _| |_| |__ \ `--. ___ __ _ _ __
1313
::: | __/ _` | __| '_ \ `--. \/ __/ _` | '_ \
1414
::: | | | (_| | |_| | | /\__/ / (_| (_| | | | |
15-
::: \_| \__,_|\__|_| |_\____/ \___\__,_|_| |_| v.1.0.1
15+
::: \_| \__,_|\__|_| |_\____/ \___\__,_|_| |_| v.1.0.2
1616

1717
for /f "delims=: tokens=*" %%A in ('findstr /b ::: "%~f0"') do @echo(%%A
1818

@@ -60,6 +60,7 @@ echo =========================================
6060
echo an - Analyze Output File
6161
echo cc - Check Connected Drives
6262
echo cd - Scan Current Directory
63+
echo sa - Scan All Connected Drives (Full Client Scan)
6364
echo.
6465
echo For a Full Hard Drive Scan - SELECT any DRIVE LETTER
6566
echo (e.g - "C" for C:\ drive)
@@ -94,6 +95,66 @@ if /I "%choice%"=="an" (
9495
goto :analyze
9596
)
9697

98+
:: scan all connected drives
99+
if /I "%choice%"=="sa" (
100+
cls
101+
echo ===================================================
102+
echo Full Client Scan - Scanning All Connected Drives
103+
echo ===================================================
104+
echo.
105+
echo Drives currently connected:
106+
echo.
107+
set "drives_found="
108+
for %%D in (C D E F G H I J K L M N O P Q R S T U V W X Y Z) do (
109+
if exist %%D:\ (
110+
echo Online: %%D:\
111+
set "drives_found=!drives_found! %%D"
112+
)
113+
)
114+
if "!drives_found!"=="" (
115+
echo No drives are currently online.
116+
pause
117+
cls
118+
goto restart
119+
)
120+
for %%D in (!drives_found!) do (
121+
set "folder=%%D:\"
122+
set "folder_name=%%D_Drive"
123+
set "output_file=%output_folder%\!folder_name!_PathScan_%formatted_date%_%formatted_time%.txt"
124+
echo.
125+
echo ===================================================
126+
echo Scanning All Connected Drives - Current Drive: %%D:\
127+
echo ===================================================
128+
echo.
129+
echo Collecting all file and folder paths from "%%D:\"
130+
echo Please wait, this may take a few moments...
131+
(
132+
echo %hostname% %formatted_date% %formatted_time%
133+
echo Start Directory: %%D:\
134+
echo.
135+
) > "!output_file!"
136+
dir /s /b "%%D:\" >> "!output_file!"
137+
if errorlevel 1 (
138+
echo.
139+
echo An error occurred while collecting paths from %%D:\. Please check your permissions or try again.
140+
) else (
141+
echo DONE - Output: !output_file!
142+
)
143+
)
144+
echo.
145+
cls
146+
color a
147+
echo ===================================================
148+
echo DONE - Process Complete
149+
echo ===================================================
150+
echo All connected drives have been scanned.
151+
echo FILES SAVED IN THE PATHSCAN FOLDER - Press ANY KEY to RETURN to SELECTION
152+
pause >nul
153+
color 7
154+
cls
155+
goto restart
156+
)
157+
97158
:: drive choice
98159
if /I "%choice%"=="cd" (
99160
set "folder=%cd%"
@@ -324,4 +385,4 @@ cls
324385
color 7
325386
goto analyze
326387

327-
endlocal
388+
endlocal

0 commit comments

Comments
 (0)