Jump to content

serb87

Member
  • Posts

    1
  • Joined

  • Last visited

  • Donations

    0.00 USD 
  • Country

    New Zealand

About serb87

Profile Information

  • OS
    Windows 7 x64

serb87's Achievements

0

Reputation

  1. Ok so I want to create a batch file that will automate a device clean feature, I want it to remove and delete all profiles except for a few folders such as "All Users and tivpriv" anyway this is what i have so far but it doesn't work quite well can anyone help me out? This is meant to allow you to specify the device id and then delete everything form the Documents and Settings folder other than all users and tivpriv for now, it works for the device im on but it wont work for another device on the same network?? Im running it as an administrator. If i change the code under the CONTINUE label to a ping command it works fine but the actual code thats meant to do deletion part wont work on any other networked device other than the one im on??? @echo off set /p DEVICE=Device? :START IF NOT EXIST "\\%DEVICE%\C$\Documents and Settings\" (GOTO DEVICE) IF EXIST "\\%DEVICE%\C$\Documents and Settings\" (GOTO CONTINUE) :CONTINUE FOR /D %%? IN ("\\%DEVICE%\c$\Documents and Settings\*") DO ( ECHO/%%~N? |FINDSTR/IL "ALL\ USERS tivpriv" >NUL 2>&1||RD/S/Q "%%~?") :DEVICE ECHO. echo ############################# Device Error! ############################### echo # # ECHO # Device not found! It's either offline or it does not exist, please # ECHO # re-enter the correct details and make sure the device is online. # echo # # echo ########################################################################### ECHO. set /p DEVICE=Device? GOTO START pause DeviceClean.txt
×
×
  • Create New...