Workstation Clean Up Script

Here is a workstation clean up script.

You will need to download the free software that is required in this script..  Other two area you need to make sure to optimize is :

Registry :

Remove unwanted programs from this Branch

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run

Services:

Insure unwanted Services are STOPPED and DISABLED

Here is the Script

[sourcecode language=”vb”]
@cleanmgr /sagerun: 1
@CleanUp.exe
@CCleaner.exe
@DELPROF ‘Delete User Profiles
@SFC /SCANNOW /PURGECACHE
@RD "C:\Program Files\Common Files\Adobe\Updater5" /S /Q
@RD "C:\Documents and Settings\%username%\Local Settings\Temp" /S /Q
@RD "C:\Documents and Settings\All Users\Application Data\Symantec\LiveUpdate\Downloads" /S /Q
@Del "C:\Documents and Settings\%username%\Local Settings\Temporary Internet Files\*.*" /F /S /Q | echo Y
@call "C:/Program Files/Mozilla Firefox/firefox.exe" -ProfileManager
@del "C:\Documents and Settings\%username%\Recent\*.*" /Q /F /S | echo Y
@EmptyRecycleBin.exe /q
@echo Y | chkdsk C: /F /X /R
@echo Y | chkdsk C: /F /X /R
@defrag c: -f -v
@defrag d: -f -v
@pagedfrg.exe
@EmptyRecycleBin.exe /q
@"C:\Program Files\Auslogics\Auslogics Duplicate File Finder\DuplicateFileFinder.exe"
@"C:\Program Files\Auslogics\AusLogics Disk Defrag\diskdefrag.exe"
@"C:\Program Files\Auslogics\AusLogics Registry Defrag\regdefrag.exe"
@exit
REM @RD "C:\Documents and Settings\All Users\Application Data\Symantec\Symantec AntiVirus Corporate Edition" /S /Q
[/sourcecode]


Assembler – enter the matrix

Best way to learn Computers! Is to learn Assembler that is what I did when I was around 16..  For a little nostalgia and time wasting.. Here are some links..

Assembly Language Tutorial – http://www.gamedev.net/reference/articles/article215.asp

x86 lins –

http://www.gamedev.net/reference/list.asp?categoryid=105

Full Tutorial – http://homepage.mac.com/randyhyde/webster.cs.ucr.edu/www.artofasm.com/Windows/HTML/AoATOC.html

Debug fun – http://blog.caustik.com/2006/08/20/dos-debug-fun/

More Debug fun – http://www.caustik.com/neetro/

NetWide Assembler – http://sourceforge.net/projects/nasm/ and http://www.nasm.us/

cpubusy.vbs

Ever needed to max out the CPU on a Windows OS for testing, here is a quick VBScript to produce 100% CPU Usage..  (Source is from VMware VCP410 Course)

[sourcecode language=”vb”]

Dim goal
Dim before
Dim x
Dim y
Dim i

goal = 2181818

Do While True
before = Timer
For i = 0 to goal
x = 0.000001
y = sin(x)
y = y + 0.00001
Next
y = y + 0.01
WScript.Echo "I did three million sines in " & Int(Timer – before + 0.5) &  " seconds!"
Loop

[/sourcecode]

[sourcecode]</pre>
chmod 744 cpubusy.pl
./cpubusy.pl

Terminate it pressing CTRL-C.

<em>#!/usr/bin/perl</em>

<em>$goal = 2181818;
while (TRUE) {
for ($i=0; $i<=$goal; $i++) {
$x = 0.000001;
$y = sin($x);
$y = $y + 0.00001;
}
next;
$y = $y + 0.01;
}</em>
<pre>
[/sourcecode]

VMWare Script to disconnect CD-rom devices and floppy drives

A physical CD-ROM or FDD that is connected to a virtual machine can prevent successful migration with VMotion and stop DRS. So it is important to insure CD-ROM and FDD are disconnected to VMs as part of regular SysAdmin Tasks. Source Reference Link:-http://communities.vmware.com/message/956136


[sourcecode language=”bash”]

#!/bin/bash

# forgotten devices.

# Edit by: Gabrie van Zanten (LogicaCMG)

vmwarelist=`vmware-cmd -l`
vmwarelist=`echo $vmwarelist | sed -e ‘s/ /*/g’`
vmwarelist=`echo $vmwarelist | sed -e ‘s/.vmx/.vmx /g’`

for vm in $vmwarelist
do
vm=`echo $vm | sed -e ‘s/*/ /g’`
vm=`echo $vm | sed -e ‘s/ \//*/g’`

if [ `vmware-cmd "$vm" getstate | sed -e ‘s/getstate() = //’` = "on" ]
then
echo Looking @ $vm
IDEBUS=`seq 0 1`
for i in $IDEBUS;
do
echo BUS : $i
IDEDEVICE=`seq 0 1`
for j in $IDEDEVICE;
do
PRESENT=`vmware-cmd "$vm" getconfig ide$i:$j.present | cut -f3 -d " "`
if [ $PRESENT = "true" ]
then
TYPE=`vmware-cmd "$vm" getconfig ide$i:$j.deviceType | cut -f3 -d " "`
if [[ $TYPE == "atapi-cdrom" || $TYPE == "cdrom-image" ]]
then
echo Found CDROM on IDE$i:$j
vmware-cmd "$vm" disconnectdevice ide$i:$j
fi
fi
done
done

FLOPPYDEV=`seq 0 1`
for f in $FLOPPYDEV;
do
echo FLOPPY $f
PRESENT=`vmware-cmd "$vm" getconfig floppy$f.present | cut -f3 -d " "`

if [ $PRESENT = "true" ]
then
echo Found FLOPPY on floppy$f
vmware-cmd "$vm" disconnectdevice floppy$f
fi
done
fi
done

[/sourcecode]