gunsmokingman Posted December 7, 2004 Posted December 7, 2004 Here is a Clean Up Cmd Template For A Ua This script removes every thing and it self Stuff In Red Is Safe To Remove From Script Stuff In Green Is What You Need To Change To Match Your Needs Stuff In Blue Can Be Changed Or Deleted Stuff In Purple Use Care In Modifing I Gunsmokingman give all users full permission to do what ever they want with this script. echo off cls color f2 mode con: Cols=45 Lines=3 :: THIS IS A TEMPLATE TO MAKE SURE THERE NO FILES LEFT OVER :: FROM A UNATTENDED INSTALL :::HERE WHERE I AM SETTING SOME DIR VARIBLES Title R1-CleanUp.cmd set SD=%Systemdrive%\Install\ set SD1=%Systemdrive%\Install\1T\ set SD2=%Systemdrive%\Install\2T\ echo. :::HERE WHERE I AM SETTING SOME DIR VARIBLES :: Build A Test Area To test This mkdir %SD1% mkdir %SD2% :: Build A Test Area To test This TO STOP THE SCRIPT :: 1000 = 1 SECOND > %SD%R1.vbs echo wscript.sleep 875 >> %SD%R1.vbs echo wscript.quit > %SD%R2.vbs echo wscript.sleep 1925 >> %SD%R2.vbs echo wscript.quit > %SD%R3.vbs echo wscript.sleep 2925 >> %SD%R3.vbs echo wscript.quit :Part1 cls color B0 :: REPLACE HERE WITH WHAT EVER IS NEEDED THESE WHERE HERE FOR THE TEST > %SD1%PART1.vbs echo MSGBOX "HERE IS THE" ^& vbcrlf ^& "FIRST ONE STARTS",VBOKONLY+48,"TESTING 1" Title RUNNING FROM TEST ONE DIR start /w wscript.exe %SD%R1.vbs start /w wscript.exe %SD1%PART1.vbs del %SD1%PART1.vbs echo. echo PART1 Completed? RmDir %SD1% start /w wscript.exe %SD%R2.vbs :Part2 :: REPLACE HERE WITH WHAT EVER IS NEEDED THESE WHERE HERE FOR THE TEST > %SD2%PART2.vbs echo MSGBOX "HERE IS THE" ^& vbcrlf ^& "SECOND ONE STARTS",VBOKONLY+48,"TESTING 2" cls color 7f :::HERE IS THE SECOND PART OF THE ACTION Title RUNNING FROM TEST TWO DIR start /w wscript.exe %SD%R1.vbs start /wait %SD2%PART2.vbs del %SD2%PART2.vbs echo. echo PART2 Completed? RmDir /s /q %SD2% start /w wscript.exe %SD%R2.vbs :: TEXT AFTER :: THESE ARE SAFE TO DELETE ::HERE THE FINAL CLEAN UP VBS ::TO DELETE MORE FOLDERS ADD THESES ::Garbage.DeleteFolder ("%Systemdrive%\Install") ADD YOUR OWN PATH TO FOLDER ::Delete=("%Systemdrive%\Install\") ::TO DELETE MORE FILES ADD THIS ::Garbage.DeleteFile ("\msg1.vbs") ADD YOUR OWN PATH TO FILE ::\ THAT MEANS THE DIR IT START FROM THIS START FROM SYSTEMROOT ::KEEP THIS PART IT REMOVES EVERY THING EVEN IT SELF :CLEANUP cls COLOR F3 TITLE FINAL CLEAN UP > %Systemdrive%\msg1.vbs echo Dim Garbage >> %Systemdrive%\msg1.vbs echo set Garbage = (CreateObject("Scripting.FileSystemObject")) >> %Systemdrive%\msg1.vbs echo msgbox "Starting Clean UP?",vbokonly+48,"Clean Up" >> %Systemdrive%\msg1.vbs echo wscript.sleep 500 >> %Systemdrive%\msg1.vbs echo Garbage.DeleteFolder ("%Systemdrive%\Install") >> %Systemdrive%\msg1.vbs echo Delete=("%Systemdrive%\Install\") >> %Systemdrive%\msg1.vbs echo Garbage.DeleteFile ("\msg1.vbs") >> %Systemdrive%\msg1.vbs echo wscript.sleep 500 >> %Systemdrive%\msg1.vbs echo Delete=("\msg1.vbs") >> %Systemdrive%\msg1.vbs echo wscript.sleep 500 start /w %Systemdrive%\msg1.vbs ECHO. ping -n 2 127.0.0.1>nul | set/p = Processing Final Clean Up! exitR1_CleanUp.cmd
gunsmokingman Posted January 7, 2005 Author Posted January 7, 2005 CompletedYES OR TIME OUT ACTION1\ Java Web Start.lnk2\ Nero StartSmart.lnk3\ Mozilla.lnk4\ Set Program Access and Defaults.lnk5\ Windows Catalog.lnk FOLDERS1 \ Drivers Folder2\ Install FolderNO Button Actions1:\ My MakecaB Utility, All You Do Is Type In The DirectoryAnd It Makes A Folder Called WHATEVER-YOU-TYPE-IN\ARCHIVEThen It Runs The MakeCab cmd Move The Files There Outputs A ExpandCmd To Where The Files Are Located. Deletes The Source Files.2:\ A way to delete 2 folder if they are not named Install OrDrivers that you may delete as part of the UA This Includes Shortcuts3\ A 3 Preselected Radio Stations4:\ Just A Delete Folder Program That WillDelete As Many Folders As You Want Until YouCancelWill Just Close The Script And Just Clean Up The Files Generated.To Edit I Will Add A link To The Code LaterI Gunsmokingman give all users full permission to do what ever they want with this script.GmanUtilities.exe
gunsmokingman Posted January 25, 2005 Author Posted January 25, 2005 (edited) This Is To Clean Up The Ua Silent No Box Or MessagesIt RemovesSHORTCUTS Removed If Present1\ Java Web Start.lnk2\ Nero StartSmart.lnk3\ Mozilla.lnk4\ Set Program Access and Defaults.lnk5\ Windows Catalog.lnk6\ $winnt$.infFOLDERS1\ Drivers Folder2\ Install Folder1\ To Edit Use Winrar And Extract The GmanSilentCUP.VBS2\ Than While Using Winrar Rename The GmanSilentCUP.VBS In The WinRar SFx To GmanSilentCUP-1.VBS Or What Ever You Want3\ Edit The GmanSilentCUP.VBS To What You Need.4\ Add Your Edit GmanSilentCUP.VBS Back To The SilentUaC.exe Using WinRar5\ Delete The GmanSilentCUP-1.VBS Or What Ever You Named It6\ Completed!Purple Are Varibles And Pathway To Specific PlacesOn Your Hard Drive. Green Are The Folders Or Files That Get DeletedOrange Are The Action These Are For Either A Folder Or FileRed Do Not Delete Or Remove Unless You Know What You Are DoingNew Code Must Be Change Manually The Down Load Is The Original CodeThis One Uses A Array And The Code Is One Line Smaller Now.To Change What Gets Delete Change What In GarbageEG = Array (Needs, To, Have, A, Comma, Unless, It, The, End)ON ERROR RESUME NEXTDim Act, AP, Fso, Garbage, UP, SD, SP, WdSet Act = WScript.CreateObject("WScript.Shell")Set Fso = CreateObject("Scripting.FileSystemObject")AP = Act.ExpandEnvironmentStrings("%AllUsersProfile%")UP = Act.ExpandEnvironmentStrings("%UserProfile%")SD = Act.ExpandEnvironmentStrings("%SystemDrive%")SP = Act.ExpandEnvironmentStrings("%SystemDrive%\Program Files")Wd = Act.ExpandEnvironmentStrings("%Windir%")Garbage = Array((AP & "\Desktop\ Java Web Start.lnk"),(AP & "\Desktop\ Nero StartSmart.lnk"),(AP & "\Desktop\ Mozilla.lnk"),_(AP & "\Start Menu\ Set Program Access and Defaults.lnk"),(AP & "\Start Menu\Windows Catalog.lnk"),(Wd & "\System32\$winnt$.inf"),_(SD & "\GmanSilentCUP.VBS"),(SD & "\Drivers"),(SD & "\Install"))For Each DelF In GarbageFso.DeleteFolder(DelF)Fso.DeleteFile(DelF)NextOn Error Resume NextDim Act, AP, Fso, UP, SD, SP, Wd, GarbageSet Act = CreateObject("WScript.Shell")Set Fso = CreateObject("Scripting.FileSystemObject")AP = Act.ExpandEnvironmentStrings("%AllUsersProfile%")UP = Act.ExpandEnvironmentStrings("%UserProfile%")SD = Act.ExpandEnvironmentStrings("%SystemDrive%")SP = Act.ExpandEnvironmentStrings("%SystemDrive%\Program Files")WD = Act.ExpandEnvironmentStrings("%Windir%")Fso.DeleteFolder(SD & "\Install")Fso.DeleteFolder(SD & "\Drivers")Fso.DeleteFile(AP & "\Desktop\Java Web Start.lnk")Fso.DeleteFile(AP & "\Desktop\Nero StartSmart.lnk")Fso.DeleteFile(AP & "\Desktop\Mozilla.lnk")Fso.DeleteFile(AP & "\Start Menu\Set Program Access and Defaults.lnk")Fso.DeleteFile(AP & "\Start Menu\Windows Catalog.lnk")Fso.DeleteFile(Wd & "\System32\$winnt$.inf")Fso.DeleteFile(SD & "\GmanSilentCUP.VBS")TO Test Copy And Paste These In The Run Box Below Herecmd.exe /c Mkdir %systemdrive%\Installcmd.exe /c Mkdir %systemdrive%\DriversTO Test Copy And Paste These In The Run Box Above HereI have updated this to include this file now $winnt$.infI Gunsmokingman give all users full permission to do what ever they want with this script.SilentUaC.exe Edited January 25, 2014 by gunsmokingman
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now