+ Post New Thread
Results 1 to 12 of 12
Windows Thread, Remote Disc clean up & Defrag in Technical; Hi all, Is there any tools that i can use to do the disc clean up and Defrag on remote ...
  1. #1
    newpersn's Avatar
    Join Date
    Nov 2010
    Location
    Gloucestershire
    Posts
    1,165
    Thank Post
    269
    Thanked 109 Times in 82 Posts
    Rep Power
    76

    Remote Disc clean up & Defrag

    Hi all,

    Is there any tools that i can use to do the disc clean up and Defrag on remote computers?

    Im on windows 7 Pro and the most of the computers are on XP Pro
    Last edited by newpersn; 8th March 2012 at 09:30 AM.

  2. #2

    Join Date
    Feb 2011
    Location
    Australia
    Posts
    109
    Thank Post
    0
    Thanked 10 Times in 10 Posts
    Rep Power
    8
    Free -> Psexec
    Paid -> Diskeeper Enterprise

  3. #3
    mwbutler's Avatar
    Join Date
    Nov 2010
    Location
    Dorset
    Posts
    234
    Thank Post
    97
    Thanked 20 Times in 17 Posts
    Rep Power
    27
    We use:

    Psexec + JkDefrag for defragging
    Psexec + ccleaner portable for cleaning up junk
    Psexec + a VBS script for deleting profiles

    I can post examples if you want after I've had my lunch.

  4. #4

    Join Date
    Feb 2011
    Location
    Australia
    Posts
    109
    Thank Post
    0
    Thanked 10 Times in 10 Posts
    Rep Power
    8
    What about a scheduled task?

  5. #5
    newpersn's Avatar
    Join Date
    Nov 2010
    Location
    Gloucestershire
    Posts
    1,165
    Thank Post
    269
    Thanked 109 Times in 82 Posts
    Rep Power
    76
    Quote Originally Posted by mwbutler View Post
    We use:

    Psexec + JkDefrag for defragging
    Psexec + ccleaner portable for cleaning up junk
    Psexec + a VBS script for deleting profiles

    I can post examples if you want after I've had my lunch.
    If you could please. That would be most helpful.

    we tired with scheduled task but the computers turn off if there not being used. Be

  6. #6

    FN-GM's Avatar
    Join Date
    Jun 2007
    Location
    UK
    Posts
    15,773
    Thank Post
    865
    Thanked 1,663 Times in 1,448 Posts
    Blog Entries
    11
    Rep Power
    442
    we tired with scheduled task but the computers turn off if there not being used. Be
    Well doing it remotely wont help there then...

  7. #7

    Michael's Avatar
    Join Date
    Dec 2005
    Location
    Birmingham
    Posts
    9,241
    Thank Post
    239
    Thanked 1,567 Times in 1,249 Posts
    Rep Power
    339
    You may find re-imaging is going to be quicker and with better results too.

  8. #8
    newpersn's Avatar
    Join Date
    Nov 2010
    Location
    Gloucestershire
    Posts
    1,165
    Thank Post
    269
    Thanked 109 Times in 82 Posts
    Rep Power
    76
    Quote Originally Posted by Michael View Post
    You may find re-imaging is going to be quicker and with better results too.
    I know. But we dont have the time to reimage the room. Just want a quick scipt that i can remotly run from my computer in the office to the classroom to delete the area in quistion.

  9. #9
    mwbutler's Avatar
    Join Date
    Nov 2010
    Location
    Dorset
    Posts
    234
    Thank Post
    97
    Thanked 20 Times in 17 Posts
    Rep Power
    27
    Quote Originally Posted by newpersn View Post
    If you could please. That would be most helpful.

    we tired with scheduled task but the computers turn off if there not being used. Be
    All these scripts are run from one of our Servers and its up to you to edit all file paths to get things working appropriately. Also the scripts are probably a bit messy and could be improved but they work for us. All batch files are run via a scheduled task and each task runs in a cycle of once every 3 weeks.

    Defrag
    - Save the code below as defrag.bat
    - We use a program called JkDefrag
    - Hopefully the below makes some sense if not you need to look into psexec basics.
    - @adefrag.txt is a file which includes all computer names which you want to be defragged.

    Code:
    D:
    cd Maintenance\Tools\PsTools\
    psexec -c -f -w c:\windows\system32 -d @adefrag.txt \\sever\Maintenance\Tools\JkDefrag\jkdefragcmd.exe -d 2 -l "jkdefrag.log" c: d: e: f: g: h:
    Junk
    - Save the bat file code below as junk.bat
    - Save the vbs scripts as junk.vbs
    - Execute the vbs script via the batch file, or via GPO etc if you want to.

    batch file
    Code:
    D:
    cd RMNetwork\RMManage\Maintenance\Tools\PsTools\
    psexec -c -f -w C:\Windows\System32 @ajunk.txt -u domain\user -p user_password cscript.exe //B \\server\Maintenance\Tools\Junk\Junk.vbs
    vbs script
    Code:
    Option Explicit
    On Error Resume Next
    Dim FSO
    set FSO=CreateObject("Scripting.FileSystemObject")
    FSO.DeleteFolder("C:\Windows\$NtUninstall*")
    FSO.DeleteFolder("C:\Windows\$NtServicePackUninstall*")
    FSO.DeleteFolder("C:\Windows\$MSI31Uninstall*")
    FSO.DeleteFolder("C:\Windows\Temp\**")
    FSO.DeleteFolder("C:\Windows\$hf*")
    FSO.DeleteFile ("C:\Windows\Temp\*")
    FSO.DeleteFile ("C:\Windows\*.log")
    Set FSO = Nothing
    Profile Remover
    - Probably better ways to do this but it works for us

    batch file
    Code:
    D:
    cd RMNetwork\RMManage\Maintenance\Tools\PsTools\
    psexec -c -f -w c:\windows\system32 @aProfileCleaner.txt -u domain\user -p user_password cscript.exe //B \\server\Maintenance\Tools\ProfileCleaner\profilecleaner.vbs
    vbs script
    Code:
    Const LocalDocumentsFolder = "C:\Documents and Settings\"
    set objFSO = createobject("Scripting.FileSystemObject")
    set objFolder = objFSO.GetFolder(localdocumentsfolder)
    on error resume next
    for each fldr in objFolder.SubFolders
    if not isexception(fldr.name) then
    objFSO.DeleteFolder fldr.path, True
    end if
    next
    
    Function isException(byval foldername)
    select case foldername
    case "All Users", "Default User", "LocalService", "NetworkService", "Administrator", "RM Default User"
    isException = True
    case Else
    isException = False
    End Select
    End Function

    Restart
    - Will remotely restart all computers in @arestart.txt

    Code:
    psshutdown.exe @arestart.txt -r -m "This PC will restart in 20 seconds. Please save your work."
    If you need help I'll try my best to explain when time allows.

    Matt
    Last edited by mwbutler; 9th March 2012 at 10:23 AM. Reason: added profile remover

  10. Thanks to mwbutler from:

    tigerstar (14th March 2012)

  11. #10
    bondbill2k2's Avatar
    Join Date
    Jan 2011
    Location
    West Midlands
    Posts
    1,011
    Thank Post
    80
    Thanked 66 Times in 51 Posts
    Blog Entries
    2
    Rep Power
    42
    CCleaner network edition for cleanup, shame defraggler isn't networked

  12. #11


    Join Date
    Feb 2007
    Location
    51.405546, -0.510212
    Posts
    8,709
    Thank Post
    220
    Thanked 2,615 Times in 1,926 Posts
    Rep Power
    777
    Quote Originally Posted by bondbill2k2 View Post
    shame defraggler isn't networked
    Windows Vista and 7 both defrag themselves automatically.

    For our XP computers we use the screensaver included with MyDefrag and set it to run when the computer has been idle at the logon screen for 10 mins or so.

  13. Thanks to Arthur from:

    bondbill2k2 (13th March 2012)

  14. #12
    bondbill2k2's Avatar
    Join Date
    Jan 2011
    Location
    West Midlands
    Posts
    1,011
    Thank Post
    80
    Thanked 66 Times in 51 Posts
    Blog Entries
    2
    Rep Power
    42
    Tell a lie looking at the Ccleaner network trial defraggle is built into the PRO edition for network use! Not cheap tho, over $2000 for 100+ computers
    Last edited by bondbill2k2; 19th March 2012 at 03:00 PM.

SHARE:
+ Post New Thread

Similar Threads

  1. Cleaning up Win32 network : tips please
    By contink in forum Windows
    Replies: 3
    Last Post: 5th March 2009, 12:59 AM
  2. AD Clean Up Tips
    By RobFuller in forum Windows
    Replies: 14
    Last Post: 11th January 2008, 11:11 PM
  3. Windows 98 machines "need cleaning up again"
    By Disorder in forum Windows
    Replies: 22
    Last Post: 21st March 2007, 09:08 AM
  4. clean up PC
    By Uraken in forum General Chat
    Replies: 9
    Last Post: 23rd February 2007, 08:03 AM
  5. Replies: 5
    Last Post: 5th March 2006, 01:22 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •