-
-
Save 0verflowme/94c17b32a424c1cedbc5b76d15e739b2 to your computer and use it in GitHub Desktop.
find_writable_locations.bat
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
REM Script to find writable locations under C:\ | |
C: | |
cd C:\TEMP\ | |
echo Creating list of all directories and sub-directories | |
dir C:\ /s /b /o:n /a:d > C:\Temp\dirs.txt | |
echo Attempting to copy puttygen.exe to all folders | |
for /F "tokens=*" %%A in (dirs.txt) do copy "C:\Temp\puttygen.exe" "%%A" /Y | |
echo Attempting to execute puttygen.exe (find writable locations) | |
for /F "tokens=*" %%A in (dirs.txt) do if exist "%%A\puttygen.exe" echo %%A >> writable_locations.txt | |
echo Deleting puttygen.exe from all locations | |
for /F "tokens=*" %%A in (dirs.txt) do del /F "%%A\puttygen.exe" | |
echo Done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment