Advanced Batch scripting Question ;)
#1
Posted 22 October 2007 - 04:33 AM
ive got a question about Batch Scripting. Is it possible to write a batch file that does the following:
Create Admin (2) User Set Password - Set Admin Password for existing Admin (1) User
Disable Offline Files
Uninstall MSNExplorer
Uninstall Messenger
Uninstall Outlook Express
Uninstall Games
Disable Audio Divice
Disable CD Drive
Disable USB Prots
Set Networkcard to 100Full Duplex
Disable Windows Firewall
Set Regkey for WSUS
Restart PC
-------------------------------------------------
100000000000000000000000Thanks in advance.
I dont want a complete batch file only hints on creating one so i can write it my self. Then nothing is better then learning by doing.
Best regards Valvaris
P.S. is Powershell better???
#2
Posted 22 October 2007 - 08:08 AM
#3
Posted 22 October 2007 - 09:56 AM
-gosh
#4
Posted 23 October 2007 - 02:04 AM
thanks for the fast reply.
I never wanted that someone wrote me the script. Im sorry for this missunderstanding.
But the only thing i wanted are the commands on how to uninstall windows apps like MSN Explorer and MSN Messenger via Batch.
I also found out how to port Regkeys via Batch also found in the Unatended area.
Like mentioned above. I dont know how to uninstall Windows Imbeded apps, Switch Offline files to deaktivate, Set Networkkard to Fullduplex 100MB, Energie settings like monitor shutdown after 20min. and Standby at none.
Im ok with batchscripting but i realy dont know how to approch this. Looked at google and didnt find anything. It dosent need to be done for use with copy paste. But a little of examples on how the attributes work and what they do. So I can edit these my self and learn in the proccess.
Thanks again @ all in advance.
Best regards Val.
#5
Posted 23 October 2007 - 05:46 AM
As an example:
Valvaris said:
Looky here:
http://koti.mbnet.fi...ale/throwoutoe/
jaclaz
#6
Posted 23 October 2007 - 06:26 AM
rundll32 advpack.dll,LaunchINFSection %SystemRoot%\inf\msmsgs.inf,BLC.Remove
As for quite some of the other things you want, install a freeware Registry monitor such as RegShot, make the changes you want on a test system and monitor the Registry to see which keys are changed. Import those via your batch script and you're done.
#7
Posted 23 October 2007 - 07:58 AM
Here is the little that ive scripted.
@echo off
echo Kreiere Lokad User und Setze Passwoerter fuer Admins
net user UsEr password /add /fullname:"lokad" /comment:"lokad"
net localgroup Administratoren UsEr /add
net accounts /maxpwage:unlimited
net user UsEr NeWPassWORD
net accounts /maxpwage:unlimited
echo Deinstalliere MSN Explorer - Messenger und Spiele
RunDLL32 advpack.dll, launchINFSection %windir%\inf\msmsgs.inf, BLC.Remove
RunDLL32 advpack.dll, launchINFSection %windir%\inf\games.inf, BLC.Remove
RunDLL32 advpack.dll, launchINFSection %windir%\inf\msmqocm.inf, BLC.Remove
echo Deinstalliere Outlook Express
reg delete HKEY_LOCAL_MACHINE\Software\Microsoft\Outlook Express
reg delete HKEY_LOCAL_MACHINE\Software\Microsoft\WAB
reg delete HKEY_CURRENT_USER\Identities
reg delete HKEY_CURRENT_USER\Software\Microsoft\Outlook Express
reg delete HKEY_CURRENT_USER\Software\Microsoft\WAB
reg delete HKEY_LOCAL_MACHINE \Software\Microsoft\Active Setup\Installed Components\{44BBA840-CC51-11CF-AAFA-00AA00B6015C}
reg delete HKEY_LOCAL_MACHINE \Software\Microsoft\Active Setup\Installed Components\{7790769C-0471-11D2-AF11-00C04FA35D02}
erase Inetcomm.dll
erase Msoeacct.dll
erase Msoert2.dll
erase Msoe.dll
erase Msoeres.dll
erase Msimn.exe
erase Oeimport.dll
erase Oemiglib.dll
erase Oemig50.exe
erase Setup50.exe
erase Wab.exe
erase Wabfind.dll
erase Wabimp.dll
erase Wabmig.exe
erase Csapi3t1.dll
erase Directdb.dll
erase Wab32.dll
erase Wab32res.dll
echo Setze WSUS Client
Regedit /S "\\Path\Path\WSUS_client.reg"
cls
echo # +---------------------------+ #
echo # !PC ist Eingestellt fuerXXX! #
echo # +---------------------------+ #
echo ///////////////////////////\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
echo Der PC wird nach dem Bestaetigen Neustarten fuer weitere
echo ------------System relevante installationen-------------
echo \\\\\\\\\\\\\\\\\\\\\\\\\\\/////////////////////////////
pause
SHUTDOWN /r /t:15 /d P:2:18
Now that realy bugs me is the Energie settings and the Offline files grrrrrrrrrrrrr.
Ill post any progress here
Best regards Val.
This post has been edited by Valvaris: 23 October 2007 - 07:59 AM
#8
Posted 23 October 2007 - 09:26 AM
reg delete "HKEY_LOCAL_MACHINE\Software\Microsoft\Outlook Express" /f
reg delete "HKEY_LOCAL_MACHINE\Software\Microsoft\WAB" /f
reg delete "HKEY_CURRENT_USER\Identities" /f
reg delete "HKEY_CURRENT_USER\Software\Microsoft\Outlook Express" /f
reg delete "HKEY_CURRENT_USER\Software\Microsoft\WAB" /f
reg delete "HKEY_LOCAL_MACHINE\Software\Microsoft\Active Setup\Installed Components\{44BBA840-CC51-11CF-AAFA-00AA00B6015C}" /f
reg delete "HKEY_LOCAL_MACHINE\Software\Microsoft\Active Setup\Installed Components\{7790769C-0471-11D2-AF11-00C04FA35D02}" /f
-> Whenever there are spaces in the path, don't forget to use quotes ("")
-> Don't forget to add a "/f" at the end, otherwise reg.exe will keep prompting you for confirmation.
As jaclaz already mentioned earlier, go to this site http://koti.mbnet.fi...ale/throwoutoe/ for uninstalling OE. They already have a comprehensive (better) .bat file for removing OE.
This post has been edited by [deXter]: 23 October 2007 - 09:31 AM
#9
Posted 23 October 2007 - 07:20 PM
Check out the threads on registry tweaks to find some more useful info.
Here's a thread on disabling "Offline Files".
This tool may also be useful to you.
#10
Posted 23 October 2007 - 08:52 PM
Ok first off, great try on the add user commands but if you use that you'll have issues in 30-60 days when the password expires because "/expires:never" refers to the account NOT the password for that account
(Im told if you have AD this isnt an issue but it has been an issue for me)
use the attached
netuser.exe (44.5K)
Number of downloads: 15 and the following bat file to prevent the password from expiring (and also disable the administrator and guest accounts)
@echo off echo creating Staff user... net user Staff /add /active:yes /expires:never /passwordchg:no /fullname:"Staff" /comment:"Staff login" netuser.exe staff /pwnexp:y echo -------------------- echo adding staff to Power Users group... net localgroup "Power Users" Staff /add echo ------------------------------------- echo adding staff to Administrators group... net localgroup "Administrators" Staff /add echo ------------------------------------- echo Disabling Administrator Account... net user Administrator /active:no /expires:never /passwordchg:no echo -------------------- echo Disabling Guest Account... net user Guest /active:no /expires:never /passwordchg:no echo -------------------- echo done pause
the next section of code will uninstall MSN messanger, disable Win Firewall/ICS, and also disable security center so it wont nag your users about "no firewall is turned on" or "your antivirus is 12 minutes out of date"
@echo off echo Uninstalling MSN/Windows Messenger... (choose no if asked to reboot) RunDll32 advpack.dll,LaunchINFSection %windir%\inf\msmsgs.inf,BLC.Remove echo ------------------------------ echo Stopping "Windows Firewall/Internet Connection Sharing (ICS)" sc stop SharedAccess > nul net start | find "Windows Firewall/Internet Connection Sharing (ICS)" > nul if errorlevel 1 echo "Windows Firewall/Internet Connection Sharing (ICS)" was stopped successfully echo Disabling "Windows Firewall/Internet Connection Sharing (ICS)" sc config SharedAccess start= disabled > nul echo ------------------------------ echo Stopping "Security Center" @sc stop wscsvc > nul net start | find "Security Center" > nul if errorlevel 1 echo "Security Center" was stopped successfully echo Disabling "Security Center" @sc config wscsvc start= disabled > nul echo ------------------------------ echo Press any key to close . . . pause > nul
Heres a snippet that kills the messenger service that lets users send messages with "net send" (we had a problem with it so its gone now)
echo ------------------------------ echo Stopping "Messenger" @sc stop Messenger > nul net start | find "Messenger" > nul if errorlevel 1 echo "Messenger" was stopped successfully echo Disabling "Messenger" @sc config Messenger start= disabled > nul echo ------------------------------ echo Press any key to close . . . pause > nul
the files in this zip will let your define a set of workgroups to choose from or specify a workgroup
Set_Workgroup_Name.zip (52.87K)
Number of downloads: 4 (zipped cause MSFN forums think .exe attachment=ok but .vbs attachment=bad
here is the script i use for getting those annoying miscellaneous item that annoy the crap out of me when im settin up a new machine: (it copies to WINDIR temporarily because it easier than reliably finding the current path)
Windows Registry Editor Version 5.00 [HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main] "Search Bar"="http://www.google.com/ie" "Start Page"="http://www.google.com" [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Applets\Tour] "RunCount"=dword:00000000 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MessengerService] "PassportBalloon"="0" [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\SpecialAccounts\UserList] "IT"=dword:00000000
What it does is set IEs searchengine and homepage to google (customize as you see fit)
Disable the windows XP tour
Disable the Add your passport to XP popup ballon (redundant(i think) if your uninstalling messenger but what the hell)
hides the user named IT from being displayed on the welcome screen or in the users control panel (customize as you see fit)
This post has been edited by Yzöwl: 24 October 2007 - 09:29 AM
Reason for edit: Reason for edit: code tags replaced to improve page rendering
#11
Posted 23 October 2007 - 09:05 PM
http://www.intelliad...m/Downloads.htm
http://www.intelliad...sabler_Free.exe (CD ROM disabler)
http://www.intelliad...bleUSB_Free.exe (USB Drive Disabler -USB mice/Keyboards/printers still work)
http://www.intelliad...sabler_Free.exe (Floppy Drive disabler)
but nothing to kill windows audio -could prolly just disable the sound card in devman or stop/disable the windows audio service
#12
Posted 24 October 2007 - 12:41 AM
thank you allot GEEK
I will post the optimized version ASAP as i can between working hours.
This Community rocks.
Best regards Val.
P.S.: Slime attack -----> THANKS-a-Mil
#13
Posted 24 October 2007 - 07:59 AM
here is the modified version of the Batch file. :)
@echo off
echo.
echo !--------------------------------------------------!
echo Kreiere Lokad User und Setze Passwoerter fuer Admins
echo !--------------------------------------------------!
echo.
copy netuser.exe %WINDIR%
net user UsEr PaSSworD /add /active:yes /expires:never /passwordchg:no /fullname:"lokad" /comment:"lokad"
netuser.exe UsEr /pwnexp:y
net localgroup "Administratoren" lokad /add
net user Administrator NeWPassWORd
netuser.exe Administrator /pwnexp:y
del %WINDIR%\netuser.exe
cls
echo.
echo -------------------------------------------------
echo Deinstalliere MSN Explorer - Messenger und Spiele
echo -------------------------------------------------
RunDLL32 advpack.dll, launchINFSection %windir%\inf\msmsgs.inf, BLC.Remove
RunDLL32 advpack.dll, launchINFSection %windir%\inf\games.inf, BLC.Remove
RunDLL32 advpack.dll, launchINFSection %windir%\inf\msmqocm.inf, BLC.Remove
cls
echo !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
echo ---Deinstalliere Outlook Express-----
echo -------------------------------------
echo WICHTIG: Ist dies ein Verwaltungs PC?
echo -------------------------------------
set choice0=
set /P choice0= Antwort (J/N)?
set /I '%choice%'=='N' GOTO end
echo. ---------------------------------------------------------------
echo. Deleting Identities (accounts, address book and email messages)
echo. ---------------------------------------------------------------
echo. User: %Username%
echo. -Deleting Identities...
RD /S /Q "%userprofile%\Application Data\Identities"
echo. -Deleting Identities (Local Settings)...
RD /S /Q "%userprofile%\Local Settings\Application Data\Identities"
echo. -Deleting Address Book...
RD /S /Q "%userprofile%\Application Data\Microsoft\Address Book"
echo.
echo. -Deleting registry entries
REG DELETE "HKCU\Identities" /f
REG DELETE "HKCU\Software\Microsoft\Outlook Express" /f
REG DELETE "HKCU\Software\Microsoft\WAB" /f
REG DELETE "HKCU\AppEvents\EventLabels\MailBeep" /f
REG DELETE "HKCU\AppEvents\Schemes\Apps\.Default\MailBeep" /f
FOR /F "tokens=2* delims= " %%A IN ('REG QUERY "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion" /v CommonFilesDir') DO SET CommonFilesDir=%%B
FOR /F "tokens=2* delims= " %%A IN ('REG QUERY "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion" /v ProgramFilesDir') DO SET ProgramFilesDir=%%B
FOR /F "tokens=2* delims= " %%A IN ('REG QUERY "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v Programs') DO SET StartMenuPrograms=%%B
cls
echo. -------------------------------
echo. Uninstalling Outlook Express...
echo. -------------------------------
echo. Uninstalling OE program files...
echo.
DEL "%systemroot%\system32\dllcache\acctres.dll"
DEL "%systemroot%\system32\dllcache\directdb.dll"
DEL "%systemroot%\system32\dllcache\inetcomm.dll"
DEL "%systemroot%\system32\dllcache\inetcomm.old"
DEL "%systemroot%\system32\dllcache\inetcomm.old"
DEL "%systemroot%\system32\dllcache\inetres.dll"
DEL "%systemroot%\system32\dllcache\msident.dll"
DEL "%systemroot%\system32\dllcache\msimn.exe"
DEL "%systemroot%\system32\dllcache\msoe.dll"
DEL "%systemroot%\system32\dllcache\msoe.old"
DEL "%systemroot%\system32\dllcache\msoeacct.dll"
DEL "%systemroot%\system32\dllcache\msoeacct.old"
DEL "%systemroot%\system32\dllcache\msoeres.dll"
DEL "%systemroot%\system32\dllcache\msoeres.old"
DEL "%systemroot%\system32\dllcache\msoert2.dll"
DEL "%systemroot%\system32\dllcache\msoert2.old"
DEL "%systemroot%\system32\dllcache\oeimport.dll"
DEL "%systemroot%\system32\dllcache\oeimport.old"
DEL "%systemroot%\system32\dllcache\oemig50.exe"
DEL "%systemroot%\system32\dllcache\oemig50.old"
DEL "%systemroot%\system32\dllcache\oemiglib.dll"
DEL "%systemroot%\system32\dllcache\oemiglib.old"
DEL "%systemroot%\system32\dllcache\setup50.exe"
DEL "%systemroot%\system32\dllcache\setup50.old"
DEL "%systemroot%\system32\dllcache\Q330994.inf"
DEL "%systemroot%\system32\dllcache\wab.exe"
DEL "%systemroot%\system32\dllcache\wab.old"
DEL "%systemroot%\system32\dllcache\wab32.dll"
DEL "%systemroot%\system32\dllcache\wab32.old"
DEL "%systemroot%\system32\dllcache\wab32res.dll"
DEL "%systemroot%\system32\dllcache\wab32res.old"
DEL "%systemroot%\system32\dllcache\wabfind.dll"
DEL "%systemroot%\system32\dllcache\wabfind.old"
DEL "%systemroot%\system32\dllcache\wabimp.dll"
DEL "%systemroot%\system32\dllcache\wabimp.old"
DEL "%systemroot%\system32\dllcache\wabmig.exe"
DEL "%systemroot%\system32\dllcache\wabmig.old"
DEL "%ProgramFilesDir%\Outlook Express\msimn.exe"
DEL "%ProgramFilesDir%\Outlook Express\msoe.dll"
DEL "%ProgramFilesDir%\Outlook Express\msoe.txt"
DEL "%ProgramFilesDir%\Outlook Express\msoeres.dll"
DEL "%ProgramFilesDir%\Outlook Express\oeimport.dll"
DEL "%ProgramFilesDir%\Outlook Express\oemig50.exe"
DEL "%ProgramFilesDir%\Outlook Express\oemiglib.dll"
DEL "%ProgramFilesDir%\Outlook Express\setup50.exe"
DEL "%ProgramFilesDir%\Outlook Express\wab.exe"
DEL "%ProgramFilesDir%\Outlook Express\wabfind.dll"
DEL "%ProgramFilesDir%\Outlook Express\wabimp.dll"
DEL "%ProgramFilesDir%\Outlook Express\wabmig.exe"
DEL "%CommonFilesDir%\Services\verisign.bmp"
DEL "%CommonFilesDir%\Services\bigfoot.bmp"
DEL "%CommonFilesDir%\Services\whowhere.bmp"
DEL "%CommonFilesDir%\System\directdb.dll"
DEL "%CommonFilesDir%\System\directdb.old"
DEL "%CommonFilesDir%\System\wab32.dll"
DEL "%CommonFilesDir%\System\wab32.old"
DEL "%CommonFilesDir%\System\wab32res.dll"
DEL "%CommonFilesDir%\System\wab32res.old"
DEL "%systemroot%\System32\acctres.dll"
DEL "%systemroot%\System32\inetcomm.dll"
DEL "%systemroot%\System32\inetcomm.old"
DEL "%systemroot%\System32\inetres.dll"
DEL "%systemroot%\System32\msident.dll"
DEL "%systemroot%\System32\msoeacct.dll"
DEL "%systemroot%\System32\msoeacct.old"
DEL "%systemroot%\System32\msoert2.dll"
DEL "%systemroot%\System32\msoert2.old"
DEL "%systemroot%\inf\msoe50.inf"
DEL "%systemroot%\inf\msoe50.pnf"
RD /S /Q "%ProgramFilesDir%\Outlook Express"
RD /S /Q "%CommonFilesDir%\Stationery"
cls
echo.
echo -----------------------------
echo Uninstalling OE help files...
echo -----------------------------
echo.
DEL %systemroot%\Help\msoe.chm
DEL %systemroot%\Help\msoe.hlp
DEL %systemroot%\Help\msoeacct.hlp
DEL %systemroot%\Help\wab.chm
DEL %systemroot%\Help\wab.hlp
echo.
echo ----------------------------
echo Uninstalling OE shortcuts...
echo ----------------------------
echo.
DEL "%userprofile%\Start Menu\Programs\Accessories\Address Book.lnk"
DEL "%StartMenuPrograms%\Outlook Express.lnk"
echo.
echo ---------------------------------------
echo Uninstalling old OE update inf files...
echo ---------------------------------------
echo.
DEL "%systemroot%\inf\q330994.inf"
DEL "%systemroot%\inf\q330994.pnf"
DEL "%systemroot%\inf\q802223.inf"
DEL "%systemroot%\inf\q802223.pnf"
DEL "%systemroot%\inf\q837009.inf"
DEL "%systemroot%\inf\q837009.pnf"
DEL "%systemroot%\inf\q823353.inf"
DEL "%systemroot%\inf\q823353.pnf"
DEL "%systemroot%\q330994.exe"
DEL "%systemroot%\q820223.exe"
DEL "%systemroot%\oewablog.txt"
DEL "%systemroot%\oeuninst.exe"
echo.
echo. unregistering DLL's and deleting registry entries...
echo.
echo.
echo. Outlook Express
REG DELETE "HKLM\Software\Microsoft\Active Setup\Installed Components\{44BBA840-CC51-11CF-AAFA-00AA00B6015C}" /f
REG DELETE "HKLM\Software\Microsoft\Outlook Express" /f
REG DELETE "HKLM\Software\Microsoft\Shared Tools\Stationery" /f
REG DELETE "HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\OutlookExpress" /f
REG DELETE "HKLM\Software\Microsoft\Windows Messaging Subsystem" /v MAPI /f
REG DELETE "HKLM\Software\Microsoft\Windows Messaging Subsystem\MSMapiApps" /v inetsw95.exe /f
REG DELETE "HKLM\Software\Microsoft\Windows Messaging Subsystem\MSMapiApps" /v choosusr.dll /f
REG DELETE "HKLM\Software\Microsoft\Windows Messaging Subsystem\MSMapiApps" /v msab32.dll /f
REG DELETE "HKLM\Software\Microsoft\Windows Messaging Subsystem\MSMapiApps" /v nwab32.dll /f
REG DELETE "HKLM\Software\Microsoft\Windows Messaging Subsystem\MSMapiApps" /v outstore.dll /f
FOR /F "tokens=2* delims= " %%A IN ('REG QUERY "HKEY_CLASSES_ROOT\mailto\shell\open\command" /ve') DO set mailto=%%B
FOR /F "tokens=2* delims= " %%A IN ('REG QUERY "HKEY_CLASSES_ROOT\news\shell\open\command" /ve') DO set news=%%B
SET marker=%mailto:*Outlook=Outlook%
SET marker=%marker:~0,7%
IF %marker% EQU Outlook REG ADD HKEY_CLASSES_ROOT\mailto\DefaultIcon /ve /t REG_SZ /d "" /f
IF %marker% EQU Outlook REG ADD HKEY_CLASSES_ROOT\mailto\shell\open\command /ve /t REG_EXPAND_SZ /d "" /f
SET marker=%news:*Outlook=Outlook%
SET marker=%marker:~0,7%
IF %marker% EQU Outlook REG ADD HKEY_CLASSES_ROOT\news\DefaultIcon /ve /t REG_SZ /d "" /f
IF %marker% EQU Outlook REG ADD HKEY_CLASSES_ROOT\news\shell\open\command /ve /t REG_EXPAND_SZ /d "" /f
echo.
echo. Wab
REG DELETE "HKLM\Software\Microsoft\Active Setup\Installed Components\{7790769C-0471-11D2-AF11-00C04FA35D02}" /f
REG DELETE "HKLM\Software\Microsoft\WAB" /f
REG DELETE "HKLM\Software\Microsoft\Internet Account Manager\Preconfigured" /f
REG DELETE "HKLM\Software\Microsoft\Internet Account Manager\Import" /f
REG DELETE "HKLM\Software\Microsoft\Windows\CurrentVersion\App Paths\wab.exe" /f
REG DELETE "HKLM\Software\Microsoft\Windows\CurrentVersion\App Paths\wabmig.exe" /f
REG DELETE "HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\AddressBook" /f
REG DELETE "HKCU\Software\Microsoft\Internet Account Manager\Accounts" /f
REG DELETE "HKCU\Software\Microsoft\Internet Account Manager\Preconfigured" /f
echo.
echo. directdb.dll
REG DELETE "HKEY_CLASSES_ROOT\CLSID\{4A16043F-676D-11d2-994E-00C04FA309D4}" /f
echo.
echo. inetcomm.dll and inetress.dll
REG DELETE "HKEY_CLASSES_ROOT\CLSID\{FD853CD9-7F86-11d0-8252-00C04FD85AB4}" /f
REG DELETE "HKEY_CLASSES_ROOT\CLSID\{FD853CDB-7F86-11d0-8252-00C04FD85AB4}" /f
REG DELETE "HKEY_CLASSES_ROOT\CLSID\{FD853CDC-7F86-11d0-8252-00C04FD85AB4}" /f
REG DELETE "HKEY_CLASSES_ROOT\CLSID\{FD853CDD-7F86-11d0-8252-00C04FD85AB4}" /f
REG DELETE "HKEY_CLASSES_ROOT\CLSID\{FD853CDE-7F86-11d0-8252-00C04FD85AB4}" /f
REG DELETE "HKEY_CLASSES_ROOT\CLSID\{FD853CDF-7F86-11d0-8252-00C04FD85AB4}" /f
REG DELETE "HKEY_CLASSES_ROOT\CLSID\{FD853CE0-7F86-11d0-8252-00C04FD85AB4}" /f
REG DELETE "HKEY_CLASSES_ROOT\CLSID\{FD853CE1-7F86-11d0-8252-00C04FD85AB4}" /f
REG DELETE "HKEY_CLASSES_ROOT\CLSID\{FD853CED-7F86-11d0-8252-00C04FD85AB4}" /f
REG DELETE "HKEY_CLASSES_ROOT\CLSID\{FD853CE2-7F86-11d0-8252-00C04FD85AB4}" /f
REG DELETE "HKEY_CLASSES_ROOT\CLSID\{FD853CE3-7F86-11d0-8252-00C04FD85AB4}" /f
REG DELETE "HKEY_CLASSES_ROOT\CLSID\{35461E30-C488-11d1-960E-00C04FBD7C09}" /f
REG DELETE "HKEY_CLASSES_ROOT\CLSID\{FD853CE6-7F86-11d0-8252-00C04FD85AB4}" /f
REG DELETE "HKEY_CLASSES_ROOT\CLSID\{FD853CE7-7F86-11d0-8252-00C04FD85AB4}" /f
REG DELETE "HKEY_CLASSES_ROOT\CLSID\{FD853CE8-7F86-11d0-8252-00C04FD85AB4}" /f
REG DELETE "HKEY_CLASSES_ROOT\CLSID\{FD853CE9-7F86-11d0-8252-00C04FD85AB4}" /f
REG DELETE "HKEY_CLASSES_ROOT\CLSID\{FD853CEA-7F86-11d0-8252-00C04FD85AB4}" /f
REG DELETE "HKEY_CLASSES_ROOT\CLSID\{FD853CEB-7F86-11d0-8252-00C04FD85AB4}" /f
REG DELETE "HKEY_CLASSES_ROOT\CLSID\{5A580C11-E5EB-11d1-A86E-0000F8084F96}" /f
REG DELETE "HKEY_CLASSES_ROOT\CLSID\{BB847B8A-054A-11d2-A894-0000F8084F96}" /f
REG DELETE "HKEY_CLASSES_ROOT\CLSID\{EA678830-235D-11d2-A8B6-0000F8084F96}" /f
REG DELETE "HKEY_CLASSES_ROOT\CLSID\{E4B28371-83B0-11d0-8259-00C04FD85AB4}" /f
REG DELETE "HKEY_CLASSES_ROOT\CLSID\{05300401-BCBC-11d0-85E3-00C04FD85AB4}" /f
REG DELETE "HKEY_CLASSES_ROOT\CLSID\{1C82EAD9-508E-11D1-8DCF-00C04FB951F9}" /f
REG DELETE "HKEY_CLASSES_ROOT\CLSID\{64577982-86D7-11d1-BDFC-00C04FA31009}" /f
REG DELETE "HKEY_CLASSES_ROOT\CLSID\{B0D17FC2-7BC4-11d1-BDFA-00C04FA31009}" /f
REG DELETE "HKEY_CLASSES_ROOT\OutlookExpress.MimeEdit" /f
REG DELETE "HKEY_CLASSES_ROOT\OutlookExpress.MimeEdit.1" /f
REG DELETE "HKEY_CLASSES_ROOT\PROTOCOLS\Handler\mhtml" /f
echo.
echo. msoe.dll
REG DELETE "HKEY_CLASSES_ROOT\CLSID\{626BAFE1-E5D6-11D1-B1DD-006097D503D9}" /f
REG DELETE "HKEY_CLASSES_ROOT\CLSID\{CAE80521-F685-11d1-AF32-00C04FA31B90}" /f
REG DELETE "HKEY_CLASSES_ROOT\CLSID\{6F74FDC6-E366-11d1-9A4E-00C04FA309D4}" /f
REG DELETE "HKEY_CLASSES_ROOT\CLSID\{6F74FDC5-E366-11d1-9A4E-00C04FA309D4}" /f
REG DELETE "HKEY_CLASSES_ROOT\CLSID\{BE09F473-7FEB-11d2-9962-00C04FA309D4}" /f
REG DELETE "HKEY_CLASSES_ROOT\CLSID\{101A8FB9-F1B9-11d1-9A56-00C04FA309D4}" /f
REG DELETE "HKEY_CLASSES_ROOT\CLSID\{E70C92A9-4BFD-11d1-8A95-00C04FB951F3}" /f
REG DELETE "HKEY_CLASSES_ROOT\CLSID\{8F0C5675-AEEF-11d0-84F0-00C04FD43F8F}" /f
REG DELETE "HKEY_CLASSES_ROOT\OutlookExpress.MessageList" /f
REG DELETE "HKEY_CLASSES_ROOT\OutlookExpress.MessageList.1" /f
REG DELETE "HKEY_CLASSES_ROOT\OutlookExpress.AddressBook" /f
REG DELETE "HKEY_CLASSES_ROOT\OutlookExpress.AddressBook.1" /f
REG DELETE "HKEY_CLASSES_ROOT\OutlookExpress.Envelope" /f
REG DELETE "HKEY_CLASSES_ROOT\OutlookExpress.Envelope.1" /f
REG DELETE "HKEY_CLASSES_ROOT\CLSID\{233A9692-667E-11d1-9DFB-006097D50408}" /f
REG DELETE "HKEY_CLASSES_ROOT\CLSID\{233A9694-667E-11d1-9DFB-006097D50408}" /f
REG DELETE "HKEY_CLASSES_ROOT\CLSID\{06BE7323-EF34-11d1-ACD8-00C04FA31009}" /f
REG DELETE "HKEY_CLASSES_ROOT\CLSID\{A08AF898-C2A3-11d1-BE23-00C04FA31009}" /f
REG DELETE "HKEY_CLASSES_ROOT\CLSID\{abc00000-0000-0000-0000-000000000000}" /f
REG DELETE "HKLM\Software\Clients\Mail\Outlook Express" /f
REG DELETE "HKLM\Software\Clients\News\Outlook Express" /f
echo.
echo. oeimport.dll
REG DELETE "HKEY_CLASSES_ROOT\CLSID\{B7AAC060-2638-11d1-83A9-00C04FBD7C09}" /f
REG DELETE "HKEY_CLASSES_ROOT\CLSID\{0A522730-A626-11D0-8D60-00C04FD6202B}" /f
REG DELETE "HKEY_CLASSES_ROOT\CLSID\{1198A2C0-0940-11d1-838F-00C04FBD7C09}" /f
REG DELETE "HKEY_CLASSES_ROOT\CLSID\{B7AAC060-2638-11d1-83A9-00C04FBD7C09}" /f
REG DELETE "HKEY_CLASSES_ROOT\CLSID\{BCE9E2E7-1FDD-11d2-9A79-00C04FA309D4}" /f
REG DELETE "HKEY_CLASSES_ROOT\CLSID\{B977CB11-1FF5-11d2-9A7A-00C04FA309D4}" /f
echo.
echo. oemiglib.dll
REG DELETE "HKEY_CLASSES_ROOT\CLSID\{A1006DE3-2173-11d2-9A7C-00C04FA309D4}" /f
echo.
echo. msident.dll
REG DELETE "HKEY_CLASSES_ROOT\CLSID\{a9ae6c91-1d1b-11d2-b21a-00c04fa357fa}" /f
echo.
echo. msoeacct.dll
REG DELETE "HKEY_CLASSES_ROOT\CLSID\{8D4B04E1-1331-11d0-81B8-00C04FD85AB4}" /f
REG DELETE "HKEY_CLASSES_ROOT\CLSID\{1438E821-B6D2-11D0-8D86-00C04FD6202B}" /f
REG DELETE "HKEY_CLASSES_ROOT\CLSID\{39981125-C287-11D0-8D8C-00C04FD6202B}" /f
REG DELETE "HKEY_CLASSES_ROOT\CLSID\{39981127-C287-11D0-8D8C-00C04FD6202B}" /f
REG DELETE "HKEY_CLASSES_ROOT\CLSID\{39981129-C287-11D0-8D8C-00C04FD6202B}" /f
REG DELETE "HKEY_CLASSES_ROOT\CLSID\{0FF15AA1-2F93-11d1-83B0-00C04FBD7C09}" /f
REG DELETE "HKEY_CLASSES_ROOT\CLSID\{911685D1-350F-11d1-83B3-00C04FBD7C09}" /f
REG DELETE "HKEY_CLASSES_ROOT\CLSID\{17869501-36C8-11d1-83B7-00C04FBD7C09}" /f
REG DELETE "HKEY_CLASSES_ROOT\CLSID\{33102459-4B30-11d2-A6DC-00C04F79E7C8}" /f
REG DELETE "HKEY_CLASSES_ROOT\CLSID\{E9C8B700-88B1-11d2-8C1F-00C04FA31009}" /f
REG DELETE "HKLM\Software\Microsoft\Internet Domains\hotmail.com" /f
echo.
echo. wab32.dll
REG DELETE "HKEY_CLASSES_ROOT\.wab" /f
REG DELETE "HKEY_CLASSES_ROOT\wab_auto_file" /f
REG DELETE "HKEY_CLASSES_ROOT\certificate_wab_auto_file" /f
REG DELETE "HKEY_CLASSES_ROOT\vcard_wab_auto_file" /f
REG DELETE "HKLM\Software\Clients\Contacts\Address Book" /f
echo.
echo. wabimp.dll
REM REG DELETE "HKLM\Software\Microsoft\WAB\Import" /f
REM REG DELETE "HKLM\Software\Microsoft\WAB\Export" /f
echo.
echo. wabfind.dll
REG DELETE "HKEY_CLASSES_ROOT\CLSID\{32714800-2E5F-11d0-8B85-00AA0044F941}" /f
REG DELETE "HKLM\Software\Microsoft\Windows\CurrentVersion\explorer\FindExtensions\Static\WabFind" /f
echo.
echo. OE updates
REG DELETE "HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\oeupdate" /f
REG DELETE "HKLM\Software\Microsoft\Active Setup\Installed Components\{F5776D81-AE53-4935-8E84-B0B283D8BCEF}" /f
REG DELETE "HKLM\Software\Microsoft\Active Setup\Installed Components\{f5173cf0-1dfb-4978-8e50-a90169ee7ca9}" /f
REG DELETE "HKLM\Software\Microsoft\Advanced INF Setup\oeupdate" /f
REG DELETE "HKLM\Software\Microsoft\Active Setup\Installed Components\{2cc9d512-6db6-4f1c-8979-9a41fae88de0}" /f
echo.
echo. Outlook Express uninstallation is completed.
echo. If you are using non-English Windows XP you may need to
echo. manually delete shortcuts.
PAUSE
:end
echo -----------------
echo Setze WSUS Client
echo -----------------
copy misc.reg %WINDIR%
regedit %WINDIR%\misc.reg /f
del %WINDIR%\miscs.reg
echo -------------------
echo Setze Energie Werte
echo -------------------
echo.
echo !---------------------------------!
echo Monitor wird eingestellt auf 20min.
echo !---------------------------------!
powercfg /monitor-timeout-ac 20
echo.
echo !------------------------------!
echo Standby wird eingestellt auf NIE
echo !------------------------------!
powercfg /standby-timeout-ac 0
echo.
echo !--------------------------!
echo Ruhezustand wird Deaktiviert
echo !--------------------------!
powercfg /hibernate-timeout-ac 0
powercfg /hibernate off
cls
echo.
echo.
echo. \\\\\\\\\\\\\\\\\\\\\\\\\\\/////////////////////////////
echo. # +---------------------------+ #
echo. # !PC ist Eingestellt fuer XXX! #
echo. # +---------------------------+ #
echo. ///////////////////////////\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
echo. Der PC wird nach dem Bestaetigen Neustarten fuer weitere
echo. ------------System relevante installationen-------------
echo. \\\\\\\\\\\\\\\\\\\\\\\\\\\/////////////////////////////
pause
SHUTDOWN /r /t:15 /d P:2:18
and the Regfile
;Windows Registry Editor Version 5.00 ;Firewall Deaktivieren [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\StandardProfile] "EnableFirewall"=dword:00000000 ;Windows Tour Deaktivieren ;Disable Windows Tour bubble popup [HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Applets\Tour] "RunCount"=dword:00000000 ;Turn Off Offline Files (System) [HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\NetCache] "Enabled"=dword:00000000 "NoConfigCache"=dword:00000001 "NoMakeAvailableOffline"=dword:00000001 "NoCacheViewer"=dword:00000001 ; Wsus Client Here is a key :P -JokE- :D
Hope untill then ive done it right. ;)
Now the only thing are the divices. Becouse i think with the tool from dl. devcon i need to know what divice i can deaktivate by id since in other tipes of systems there is different hardware or is this a cool general solution ;)
Best regards Val.
P.S. I will modify the batch for OE in the german XP Pro and post this here too.
#14
Posted 24 October 2007 - 08:02 AM
Quote
Msoeacct.dll
Msoert2.dll
Msoe.dll
Msoeres.dll
Msimn.exe
Oeimport.dll
Oemiglib.dll
Oemig50.exe
Setup50.exe
Wab.exe
Wabfind.dll
Wabimp.dll
Wabmig.exe
Csapi3t1.dll
Directdb.dll
Wab32.dll
Wab32res.dll
and you put:
FOR /F %%A IN (todelete.txt) DO DEL %%A
in your batch, it is easier to read and to modify (adding or removing files to the todelete.txt list)
This is a VERY good site to get ideas from:
http://www.robvanderwoude.com/
jaclaz
#15
Posted 24 October 2007 - 08:31 AM
::Syntax - DEL [/switches] names ::Example - DEL file1.ext file2.ext file3.ext file4.extWhere does %choice% come from? and why create a reg file, copy it, invoke it and delete it when you could just incorporate it in your batch file.
#16
Posted 05 November 2007 - 08:56 AM
like promised for all here is the Batch. The only thing that was missing was the MSN Explorer and the other Progs.
@echo off echo. echo !--------------------------------------------------! echo Kreiere Lokad User und Setze Passwoerter fuer Admins echo !--------------------------------------------------! echo. copy "x:\Path\Path of Netuser.exe" %WINDIR% net user UsEr PaSsWORd! /add /active:yes /expires:never /passwordchg:no /fullname:"UsEr" /comment:"UsEr" netuser.exe UsEr /pwnexp:y net localgroup "Administratoren" lokad /add net localgroup "Benutzer" UsEr /delete net user Administrator PassWORd netuser.exe Administrator /pwnexp:y ping -n 5 127.0.0.1>nul del %WINDIR%\netuser.exe cls echo. echo !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! echo !----------------------------------! echo !Wichtig ist die ein Text echo !----------------------------------! echo !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! SET Choice0= SET /P Choice0= (J/N)? IF /I '%Choice0%'=='J' GOTO continue cls echo. echo !---------------! echo Deaktiviere Audio echo !---------------! copy "x:\Path\Path to devcon.exe" %WINDIR% devcon /r disable =media ping -n 10 127.0.0.1>nul echo !-------------! echo Deaktiviere USB echo !-------------! devcon /r disable =usb ping -n 10 127.0.0.1>nul echo. echo !------------! echo Deaktiviere CD echo !------------! devcon /r disable =cdrom ping -n 10 127.0.0.1>nul del %WINDIR%\devcon.exe :continue cls echo. echo ----------------------- echo Deinstalliere Messenger echo ----------------------- RunDLL32 advpack.dll,LaunchINFSection %systemroot%\inf\msmsgs.inf,BLC.Remove cls echo. echo !!!!!!!!!!!!!!!!!!!!!!!!!! echo -------------------------- echo Deaktiviere WinXP Firewall echo -------------------------- echo !!!!!!!!!!!!!!!!!!!!!!!!!! netsh firewall set opmode disable cls echo. echo ----------------- echo Setze WSUS Client echo ----------------- copy "x:\Path\Path to misc.reg" %WINDIR% regedit %WINDIR%\misc.reg del %WINDIR%\miscs.reg cls echo. echo ------------------- echo Setze Energie Werte echo ------------------- echo. powercfg /setactive desktop echo !---------------------------------! echo Monitor wird eingestellt auf 20min. echo !---------------------------------! powercfg /change desktop /monitor-timeout-ac 20 echo. echo !------------------------------! echo Standby wird eingestellt auf NIE echo !------------------------------! powercfg /change desktop /standby-timeout-ac 0 echo. echo !--------------------------! echo Ruhezustand wird Deaktiviert echo !--------------------------! powercfg /change desktop /hibernate-timeout-ac 0 powercfg /hibernate off cls echo. echo. echo. ---------\\\\\\\\\\\\\\\\\\\\\\\\\\\/////////////////////////////--------- echo. ---------# +---------------------------+ #--------- echo. ---------# !PC ist Eingestellt fuer Text! #--------- echo. ---------# +---------------------------+ #--------- echo. ---------///////////////////////////\\\\\\\\\\\\\\\\\\\\\\\\\\\\\--------- echo. ---------Der PC wird nach dem Bestaetigen Neustarten fuer weitere--------- echo. ---------------------System relevante installationen---------------------- echo. ---------\\\\\\\\\\\\\\\\\\\\\\\\\\\/////////////////////////////--------- pause cls echo. echo. Logo is in Ascii echo. echo Bitte Warten... ping -n 10 127.0.0.1>nul shutdown -t 10 -c "System startet jetzt Neu" -r
Thank to all that gave me the Tips and Hints required to meke a nice funktioning batch.
Best regards @ all from Val.
#17
Posted 05 November 2007 - 10:13 AM
Quote
copy "x:\Path\Path of Netuser.exe" %WINDIR% <snip> net user <snip> del %WINDIR%\netuser.exe <snip> copy "x:\Path\Path to devcon.exe" %WINDIR% devcon <snip> del %WINDIR%\devcon.exe <snip> copy "x:\Path\Path to misc.reg" %WINDIR% regedit %WINDIR%\misc.reg del %WINDIR%\miscs.reg
#18
Posted 06 November 2007 - 03:50 AM
I was thinking on executing it on a local machine this would be necessary. Nope i was wrong.... the files are on a central server were all the clients have access. AAAAAhhhhhhh
OK shoot me- > JOKE
Best regards Val.
- ← Suggested Sites
- Programming (C++, Delphi, VB/VBS, CMD/batch, etc.)
- need a short vbscript to insert data in database →



Help
Back to top









