@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
Fiz lote para excluir pastas de perfis de usuários remotos mas não posso executar para PCs remotos? Onde está o problema no script?
Tags remote batch-file user-folders