Created
August 23, 2020 00:19
-
-
Save malbert911/4afdccb8669eefd8909f905e27cb2589 to your computer and use it in GitHub Desktop.
Remote Windows Workstation cleanup v1.1
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 | |
cls | |
echo Remote Windows Workstation cleanup v1.1 | |
echo (c)Matthew Albert | |
set /p canis="Enter the hostname (example: C732534 or internal-server-1): " | |
set /p user="Enter the user name of the main user (example: MALBERT): " | |
echo =================================================== | |
echo This script will: | |
echo Connect to: %canis% | |
echo delete C:\Windows\temp" | |
echo delete C:\Users\%user%\AppData\Local\Temp" | |
echo and reboot. | |
echo Are you Sure You Want To Proceed? (Close this window to cancel) | |
PAUSE | |
winrs -r:%canis% del /S /F /Q C:\Windows\temp | |
winrs -r:%canis% del /S /F /Q C:\Users\%user%\AppData\Local\Temp | |
winrs -r:%canis% shutdown /r /f | |
PAUSE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Only works well if you have domain level admin from the account you are running this.