@ECHO OFF
:ProfilDeleter
SET /P PC=Enter Remote Ip/HostName (for Exit press M):
if [%PC%]==[] cls && @echo you should fill && goto ProfilDeleter
if %PC%==m goto :Menu
if %PC%==M goto :Menu
SET /p NotToBeDeleted=Your UserName:
cls
::HERE NOT WORKING
SET Profiles=\%PC%C$Users
PushD "%Profiles%"
if /I Not "%CD%"=="%Profiles%" (ECHO. Unable to find %Profiles% exiting)&Pause&goto Menu
FOR /F "Delims=" %%I in ('Dir /AD /B ^|FindStr /I /V /C:"%NotToBeDeleted%" /C:"ADMINI~1" /C:"Public" /C:"Default" /C:"Administrator"') DO RD /Q /S "%%I"
PopD
pause
:Menu
Exit
I made batch in order to delete Remote User Profile Folders But I can't run for Remote PCs? Where is the problem in the script?
- - , .
برچسب:
نویسنده: استخدام کار