Autologon i RunOnceEx#

Skrypty które automatycznie logują się na dany komputer i odpalają dany program moga stworzyć prosty system instalacji oprogramowania. Taki przykładowy skrypt to:

@ECHO OFF

REM Setting Autologon

REG ADD "\\%1\HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon" /v "DefaultDomainName" /t REG_SZ /d "PJWSTK" /f
REG ADD "\\%1\HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon" /v "DefaultUserName" /t REG_SZ /d "Admin_Name" /f
REG ADD "\\%1\HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon" /v "DefaultPassword" /t REG_SZ /d "Admin_Password" /f
REG ADD "\\%1\HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon" /v "AutoAdminLogon" /t REG_SZ /d 1 /f
REG ADD "\\%1\HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon" /v "AutoLogonCount" /t REG_SZ /d 1 /f
REG ADD "\\%1\HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon" /v "ForceAutoLogon" /t REG_SZ /d 1 /f
REG ADD "\\%1\HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon" /v "CachePrimaryDomain" /t REG_SZ /d "PJWSTK" /f
REG ADD "\\%1\HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon" /v "AltDefaultUserName" /t REG_SZ /d "pkrzysz" /f
REG ADD "\\%1\HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon" /v "AltDefaultDomainName" /t REG_SZ /d "PJWSTK" /f
REG ADD "\\%1\HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon" /v "DontDisplayLastUserName" /t REG_SZ /d "0" /f
REG ADD "\\%1\HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon\DomainCache" /v "PJWSTK" /t REG_SZ /d "pjwstk.edu.pl" /f

REM Setting Autostart

REG ADD "\\%1\HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx" /t REG_SZ /v Title /d "Installing Additional Software" /f
REG ADD "\\%1\HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx" /t REG_DWORD /v Flags /d 306 /f
REG ADD "\\%1\HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx\install01" /t REG_SZ /v "" /d "Preparing install" /f
rem REG ADD "\\%1\HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx\install01" /t REG_SZ /v 1 /d "rundll32.exe user32.dll, LockWorkStation " /f
REG ADD "\\%1\HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx\install01" /t REG_SZ /v 2 /d "fsutil quota modify c: 80000000000 80000000000 PJWSTK\pkrzysz" /f
REG ADD "\\%1\HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx\install01" /t REG_SZ /v 3 /d "fsutil quota modify c: 80000000000 80000000000 PJWSTK\risasi" /f
REG ADD "\\%1\HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx\install01" /t REG_SZ /v 4 /d "fsutil quota disable d:" /f

REG ADD "\\%1\HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx\install02" /t REG_SZ /v "" /d "Installing..." /f
REG ADD "\\%1\HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx\install02" /t REG_SZ /v 1 /d "echo ." /f

REG ADD "\\%1\HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx\install03" /t REG_SZ /v "" /d "Cleaning Registry..." /f
REG ADD "\\%1\HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx\install03" /t REG_SZ /v 1 /d "reg.exe add """HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon""" /v """DefaultDomainName""" /t REG_SZ /d """PJWSTK""" /f" /f
REG ADD "\\%1\HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx\install03" /t REG_SZ /v 2 /d "reg.exe add """HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon""" /v """AutoAdminLogon""" /t REG_SZ /d """0""" /f" /f
REG ADD "\\%1\HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx\install03" /t REG_SZ /v 3 /d "reg.exe add """HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon""" /v """AutoLogonCount""" /t REG_SZ /d """0""" /f" /f
REG ADD "\\%1\HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx\install03" /t REG_SZ /v 4 /d "REG.exe DELETE """HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon""" /v """DefaultUserName""" /f" /f
REG ADD "\\%1\HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx\install03" /t REG_SZ /v 5 /d "REG.exe DELETE """HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon""" /v """DefaultPassword""" /f" /f
REG ADD "\\%1\HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx\install03" /t REG_SZ /v 6 /d "REG.exe DELETE """HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon""" /v """ForceAutoLogon""" /f" /f
REG ADD "\\%1\HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx\install03" /t REG_SZ /v 7 /d "rEG.exe DELETE """HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon""" /v """DontDisplayLastUserName""" /f" /f
REG ADD "\\%1\HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx\install03" /t REG_SZ /v 8 /d "REG.exe DELETE """HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run""" /v """afterreboot""" /f" /f

REG ADD "\\%1\HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx\install04" /t REG_SZ /v "" /d "Rebooting..." /f
REG ADD "\\%1\HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx\install04" /t REG_SZ /v 1 /d "shutdown -r -t 0 -f" /f


shutdown -r -f -t 0 -m \\%1

Wednesday, March 01, 2006 1:53:18 PM (Central European Standard Time, UTC+01:00) #    Comments [0]  |  Trackback

 

All content © 2009, Krzysztof Pietrzak
On this page
This site
Calendar
<January 2009>
SunMonTueWedThuFriSat
28293031123
45678910
11121314151617
18192021222324
25262728293031
1234567
Archives
Sitemap
Blogroll OPML
  Tokyo by night
blog WiTa
  W-Files
blog n€x¤Ra
 .:fotoblog:.
blog Kfaza
 \\archon\blog$
blog archona
 Czasowstrzymywacz
Blog Fookyego
 Jog Pstryka
Jog Pstryka
 Mac OS X vs. Active Directory
techniczny blog kfaza

Maps
Locations of visitors to this page