+ Post New Thread
Results 1 to 6 of 6
Scripts Thread, Re the request for a workstation clean up script... in Coding and Web Development; This will need a bit of editing... @echo off :************************************************* **************** :* :* This script is designed to tidy up ...
  1. #1

    Join Date
    Mar 2006
    Posts
    5
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Re the request for a workstation clean up script...

    This will need a bit of editing...

    @echo off
    :************************************************* ****************
    :*
    :* This script is designed to tidy up WinXP and Win2k client machines
    :*
    :* Ver: 1.2
    :* Date: 01/04/04
    :*
    :************************************************* ****************

    :************************************************* ****************
    :Set the time of the computer to that of the domain controller
    :************************************************* ****************
    echo Setting the time
    net time /domain:boys /set /y


    :************************************************* ****************
    :flowol fix
    :************************************************* ****************

    rem \\boys.jktc.uk\home\Software\Flowol2\Install_Mimic _Creator\Setup.exe
    rem \\boys.jktc.uk\home\Software\Flowol2\Install_Mimic _Creator\SetupEx.exe
    xcopy /c/r/y \\ict_srv1\netlogon\flowol2_Default.ini %windir%\flowol2.ini

    :************************************************* ****************
    :merge in useful registry entries
    :************************************************* ****************
    echo adding registry entries
    regedit.exe /s "\\ict_srv1\NETLOGON\Standard_Student.reg"
    ause

    :************************************************* ****************
    :copy JKBTC Wallpapers
    :************************************************* ****************
    c:
    cd c:\
    if exist c:\wallpapers goto SkipWall

    echo copying Wallpapers
    xcopy "\\ict_srv1\NETLOGON\Wallpapers" "C:\Wallpapers\" /h /r /c /y
    ause

    :SkipWall

    :************************************************* ****************
    : install qca exams
    :************************************************* ****************
    rem "\\boys.jktc.uk\Software\QCATest2005\KS3ICT-2005-P-ABC 2215\KS3ICT-2005-P-ABC 2215.msi" /q
    rem "\\boys.jktc.uk\Software\QCATest2005\KS3ICT-2005-P-FMA 3084\KS3ICT-2005-P-FMA 3084.msi" /q
    rem "\\boys.jktc.uk\Software\QCATest2005\KS3ICT-2005-P-FMB 3084\KS3ICT-2005-P-FMB 3084.msi" /q
    rem "\\boys.jktc.uk\Software\QCATest2005\KS3ICT-2005-S-PRE 1430\KS3ICT-2005-S-PRE 1430.msi" /q

    :************************************************* ****************
    :copy special version of MS Paint
    :************************************************* ****************
    rem c:
    rem cd c:\
    rem echo copying MS Paint (Special Version)
    rem xcopy "\\ict_svr\1111 config files\hex edits for apps\mspaint.exe" %windir%\system32\dllcache\mspaint.exe /h /r /c /y
    rem xcopy "\\ict_svr\1111 config files\hex edits for apps\mspaint.exe" %windir%\system32\mspaint.exe /h /r /c /y
    ause

    :************************************************* ****************
    : Move to location for "profiles" and remove old profiles
    :************************************************* ****************
    echo "Removing profiles"

    cd "c:\Documents and Settings"

    if exist DeleteFolders.log del /Q DeleteFolders.log

    : Hide foldes we want to keep
    attrib +H Admin*
    attrib +H "Default User"
    attrib +H "Default User (Network)"
    attrib +H "All Users"
    attrib +H sweepupd
    attrib +H Clean*.

    ause

    : Get list of visible folders. These are the ones we delete
    dir /b >> DeleteFolders.log

    FOR /F "tokens=*" %%A in (DeleteFolders.log) do rmdir /S /Q "%%A"

    if exist DeleteFolders.log del /Q DeleteFolders.log

    ause

    :Unhide the folders

    attrib -H Admin*
    :attrib -H "Default User"
    :attrib -H "Default User (Network)"
    attrib -H "All Users"
    attrib -H sweepupd
    attrib -H Clean*.

    ause

    :************************************************* ****************
    elete some temporary files (Windows and Internet Explorer)
    :************************************************* ****************
    echo Delete temporary files
    del /q /s "c:\Documents and Settings\Admin\local settings\Temporary internet files\*.*"
    del /q /s "c:\Documents and Settings\Admin\local settings\Temp\*.*"
    del /q /s "c:\Documents and Settings\Administrator\local settings\Temporary internet files\*.*"
    del /q /s "c:\Documents and Settings\Administrator\local settings\Temp\*.*"

    ause

    :************************************************* ****************
    : Hide various important folders and files in top level of C:
    :************************************************* ****************
    echo tidy up c:\
    cd C:\

    attrib +H "Documents and Settings"
    attrib +H "Program Files"
    attrib +H "RECYCLER"
    attrib +H "System Volume Information"
    attrib +H "%windir%"
    attrib +H "arcldr.exe"
    attrib +H "arcsetup.exe"
    attrib +H "AUTOEXEC.bat"
    attrib +H "boot.ini"
    attrib +H "CONFIG.SYS"
    attrib +H "IO.SYS"
    attrib +H "MSDOS.SYS"
    attrib +H "ntldr*"
    attrib +H "pagefile.sys"

    ause

    :************************************************* ****************
    : Tidy up the contents of the top level of the C:
    :************************************************* ****************
    cd c:\

    del c:\*.jif
    del c:\*.txt
    del c:\*.tmp
    del c:\*.doc
    del c:\*.xls
    del c:\*.pub
    del c:\*.bmp
    del c:\*.jpg
    del c:\*.zip
    del c:\*.gbc
    del c:\*.wma
    del c:\*.wav
    del c:\*.mp3
    del c:\*.mpeg
    del c:\*.mpga
    del c:\*.avi
    del c:\*.wa_
    del c:\*.rm_
    del c:\*.pdf
    del c:\*.htm
    del c:\*.html
    del c:\*.theme
    del c:\newfol~1\*.* /Q /S
    rd c:\newfol~1 /Q /S
    del c:\~

    ause

    :************************************************* ****************
    : Tidy up the Temp directory
    :************************************************* ****************
    echo Tidy up Temp dir etc
    del c:\temp\*.* /Q /S
    rd c:\temp\ /Q /S
    md c:\Temp

    del %windir%\temp\*.* /Q /S
    rd %windir%\temp\ /Q /S
    md %windir%\Temp

    :************************************************* ****************
    : Tidy up "Program Files"
    :************************************************* ****************
    del c:\progra~1\*.pub
    del c:\progra~1\*.doc
    del c:\progra~1\*.xls

    :************************************************* ****************
    : Tidy up "Windows directory"
    :************************************************* ****************
    cd %windir%
    del %windir%\*.txt
    del %windir%\*.tmp
    del %windir%\*.doc
    del %windir%\*.xls
    del %windir%\*.pub
    del %windir%\*.cdr
    del %windir%\*.acl
    del %windir%\*.pcb
    del %windir%\*.asd
    del %windir%\*.jpg
    del %windir%\*.gif
    del %windir%\*.cct
    del %windir%\*.dmp
    del %windir%\*.wma
    del %windir%\*.zip
    del %windir%\*.gbc
    del %windir%\*.mp3
    del %windir%\*.mpeg
    del %windir%\*.mpga
    del %windir%\*.avi
    del %windir%\*.wa_
    del %windir%\*.rm_
    del %windir%\*.pdf
    del %windir%\~

    ause

    :************************************************* ****************
    : logoff from the machine
    :************************************************* ****************
    if NOT exist %windir%\system32\down.exe xcopy \\ict_srv1\NETLOGON\down.exe %windir%\system32\ /h /r /c /y
    ause
    %windir%\system32\down hostname /R /Q 20 "Rebooting this machine"

  2. #2

    john's Avatar
    Join Date
    Sep 2005
    Location
    London
    Posts
    10,507
    Thank Post
    1,492
    Thanked 1,050 Times in 919 Posts
    Rep Power
    302

    Re: Re the request for a workstation clean up script...

    Thats really really detailed, nice script

  3. #3

    Join Date
    Mar 2006
    Posts
    5
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Re: Re the request for a workstation clean up script...

    My pleasure John. I can't take full credit for it though! I started it as an NT script that could be called locally or from the logon. It did a good job under good old NT. Since then, and moving on to 2k and XP, myself and various colleagues have added and enhanced it. My present co worker has a good programing background. Time permiting, I'll see if we've got any others that can be put in the scripts forum. I'm new to this board, and I look forward to having the time to explore it fully.

    down.exe is a little nt/2k-ish util to shut down/reboot a pc- might not be ok for xp?
    (http://www.losoft.de/)
    The version of paint.exe is one that was bent using a 'hex editor' (?) to remove the 'save this image as wallpaper' grief.

    Here's a very early version of script, just for fun...

    cd c:\winnt\profiles

    del DeleteFolders.log

    attrib +H Admin
    attrib +H Administrator
    attrib +H "Default User"
    attrib +H "Default User (Network)"
    attrib +H "All Users"
    attrib +H sweepupd
    attrib +H "Clean"

    dir /b >> DeleteFolders.log

    FOR /F "tokens=*" %%A in (DeleteFolders.log) do rmdir /S /Q "%%A"

    if exist DeleteFolders.log del /Q DeleteFolders.log

    attrib -H Admin
    attrib -H Administrator
    attrib -H "Default User"
    attrib -H "All Users"
    attrib -H sweepupd
    attrib -H "Default User (Network)"

    cd c:\winnt\profiles\admin\local settings\Temporary internet files\*.*

    cd\

    net time /domain:jkb_masternet /set /y
    del c:\*.jif
    del c:\*.txt
    del c:\*.tmp
    del c:\*.doc
    del c:\*.xls
    del c:\*.pub
    del c:\*.bmp
    del c:\*.jpg
    del c:\*.zip
    del c:\*.gbc
    del c:\*.wma
    del c:\*.wav
    del c:\*.mp3
    del c:\*.mpeg
    del c:\*.mpga
    del c:\*.avi
    del c:\*.wa_
    del c:\*.rm_
    del c:\*.pdf
    del c:\*.htm
    del c:\*.html
    del c:\newfol~1\*.* /Q /S
    rd c:\newfol~1 /Q /S
    del c:\~

    del c:\temp\*.* /Q /S
    rd c:\temp\ /Q /S
    md c:\Temp

    del c:\progra~1\*.pub
    del c:\progra~1\*.doc
    del c:\progra~1\*.xls

    del c:\winnt\*.txt
    del c:\winnt\*.tmp
    del c:\winnt\*.doc
    del c:\winnt\*.xls
    del c:\winnt\*.pub
    del c:\winnt\*.cdr
    del c:\winnt\*.acl
    del c:\winnt\*.pcb
    del c:\winnt\*.asd
    del c:\winnt\*.jpg
    del c:\winnt\*.gif
    del c:\winnt\*.cct
    del c:\winnt\*.dmp
    del c:\winnt\*.wma
    del c:\winnt\*.zip
    del c:\winnt\*.gbc
    del c:\winnt\*.mp3
    del c:\winnt\*.mpeg
    del c:\winnt\*.mpga
    del c:\winnt\*.avi
    del c:\winnt\*.wa_
    del c:\winnt\*.rm_
    del c:\winnt\*.pdf
    del c:\*.jif
    del c:\winnt\~

    del c:\winnt\Personal\*.* /Q /S
    del c:\winnt\Personal\~ /Q /S
    rd c:\winnt\Personal\ /Q /S
    md c:\winnt\Personal


    del c:\winnt\cookies\index.dat
    del c:\winnt\cookies\*.txt


    DEL c:\winnt\tempor~1\*.* /Q /S
    rd c:\winnt\tempor~1\ /Q /S
    md "c:\winnt\Temporary Internet Files"

    : choice/c:./t.,10/n

    c:\winnt\system32\down hostname /l /Q

  4. #4

    plexer's Avatar
    Join Date
    Dec 2005
    Location
    Norfolk
    Posts
    13,331
    Thank Post
    622
    Thanked 1,578 Times in 1,415 Posts
    Rep Power
    413

    Re: Re the request for a workstation clean up script...

    Down can also be called using a text file containing pc names and a for loop in a batch script to shut down whole rooms this could also be scheduled.

    Ben

  5. #5

    Join Date
    Mar 2006
    Posts
    5
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Re: Re the request for a workstation clean up script...

    Thanks Ben. I remember the first time I used it with a text file to shut down a room, and the feeling of satisfaction. Pity it didn't shut the room down permanently...
    But does it work with XP ? (no time to test).
    I've got some WOL shutdown progs somewhere, again, it's just no time to develop.

  6. #6
    Norphy's Avatar
    Join Date
    Jan 2006
    Location
    Harpenden
    Posts
    2,236
    Thank Post
    50
    Thanked 273 Times in 211 Posts
    Blog Entries
    6
    Rep Power
    108

    Re: Re the request for a workstation clean up script...

    if down.exe is a shutdown tool, it isn't needed in XP. XP has it's own shutdown tool called shutdown.exe. Its located in the %systemroot%\system32 directory.

SHARE:
+ Post New Thread

Similar Threads

  1. AD Clean Up Tips
    By RobFuller in forum Windows
    Replies: 14
    Last Post: 11th January 2008, 11:11 PM
  2. clean up PC
    By Uraken in forum General Chat
    Replies: 9
    Last Post: 23rd February 2007, 08:03 AM
  3. Replies: 3
    Last Post: 25th September 2006, 12:27 PM
  4. Clean permanent marker off projector lens
    By ken_kaniff in forum How do you do....it?
    Replies: 12
    Last Post: 25th May 2006, 06:20 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
  •