Jump to content

Recommended Posts

Posted (edited)

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

Edited by newpersn
Posted

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.

Posted
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

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

 

Well doing it remotely wont help there then...

Posted
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.

Posted (edited)
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.

 

D:
cd Maintenance\Tools\PsTools\
psexec -c -f -w c:\windows\system32 -d @[b][url="http://www.edugeek.net/member.php?u=11644"]ade[/url][/b]frag.txt [url="file://\\sever\Maintenance\Tools\JkDefrag\jkdefragcmd.exe"]\\sever\Maintenance\Tools\JkDefrag\jkdefragcmd.exe[/url] -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

D:
cd RMNetwork\RMManage\Maintenance\Tools\PsTools\
psexec -c -f -w C:\Windows\System32 @[b][url="http://www.edugeek.net/member.php?u=13033"]aju[/url][/b]nk.txt -u domain\user -p user_password cscript.exe //B [url="file://\\server\Maintenance\Tools\Junk\Junk.vbs"]\\server\Maintenance\Tools\Junk\Junk.vbs[/url]

 

vbs script

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

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 [url="file://\\server\Maintenance\Tools\ProfileCleaner\profilecleaner.vbs"]\\server\Maintenance\Tools\ProfileCleaner\profilecleaner.vbs[/url]

 

vbs script

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

 

psshutdown.exe @[b][url="http://www.edugeek.net/member.php?u=18526"]ares[/url][/b]tart.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

Edited by mwbutler
added profile remover
  • Thanks 1
Posted (edited)
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 Edited by bondbill2k2

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...