Script de logon
Description du code
Code source ou contenu du fichier
Code Winbatch (Script de logon) (191 lignes)
;******************************************************************** ;* Name of File : LOGON.SCR (for Nothing Hill) ;* Date of Creation : ;* Author : ;* ;* last update : ;********************************************************************* ;================================ ;DECLARATION OF CERTAIN VARIABLES ;================================ $ssname = "worldsave!.scr" $UpdateFile = "20021025-004-" + "i32.exe" ;====================================== ;SETTING DOS SCREENS IN FULLSCREEN MODE ;====================================== WriteValue("HKEY_USERS\.DEFAULT\Console","Fullscreen","1","REG_DWORD") WriteValue("HKEY_CURRENT_USER\Console","Fullscreen","1","REG_DWORD") ;================ ;CLEAR THE SCREEN ;================ cls ;====================== ;SHOWING WELCOME SCREEN ;====================== COLOR w+/b BOX(0,0,25,79,double) COLOR y+/b AT (1,52) small "@DAY @MDAYNO @MONTH @YEAR" AT (1,3) small "Hello @USERID," COLOR w+/b BOX(2,2,4,77,single) AT (3,15) small "Welcome on the LAN of BELUROKOS Nothing Hill" COLOR w+/b SLEEP 2 ;---------------------------------------- ;--------------------------------- ;Synchronizing with Server Clock ;--------------------------------- AT (6,5) "1. Synchronizing with Server Clock ..." ;AT (6,5) "" SHELL 'ECHO forbidden|su administrator CMD /C net time \\G20220S0003 /set /y >nul' sleep 1 ;------------------------------------------------------- ; CHECK IF SCREENSAVER EXISTS ON LOCAL DRIVE ; IF NOT COPY THE SCREENSAVER FROM SERVER TO LOCAL DRIVE ;------------------------------------------------------- AT (7,5) "2. Configuring ScreenSaver" AT (8,5) "" $result = exist("c:\WINNT\system32\sstext3d.scr") if $result=0 SHELL 'CMD /C xcopy "\\G20220S0003\netlogon\sstext3d.scr" "c:\WINNT\system32\" >nul' endif ;--------------------------------------------- ; WRITE SCREENSAVER SETTINGS TO LOCAL REGISTRY ;--------------------------------------------- ;$Result = EXISTKEY("HKEY_CURRENT_USER\Control Panel\Screen Saver.3Dtext") ; - CREATING KEY CONCERNING THE 3DText SCREENSAVER IF existkey( "HKEY_CURRENT_USER\Control Panel\Screen Saver.3Dtext" ) <> "0" $result = addkey( "HKEY_CURRENT_USER\Control Panel\Screen Saver.3Dtext" ) ELSE $result = 0 ENDIF ; - WRITING VALUES IN REGISTRY CONCERNING THE 3DText SCREENSAVER - IF $Result = 0 WRITEVALUE("HKEY_CURRENT_USER\Control Panel\Screen Saver.3DText","DemoType","0",REG_SZ) WRITEVALUE("HKEY_CURRENT_USER\Control Panel\Screen Saver.3DText","RotStyle","2",REG_SZ) WRITEVALUE("HKEY_CURRENT_USER\Control Panel\Screen Saver.3DText","Tesselation","50",REG_SZ) WRITEVALUE("HKEY_CURRENT_USER\Control Panel\Screen Saver.3DText","Size","72",REG_SZ) WRITEVALUE("HKEY_CURRENT_USER\Control Panel\Screen Saver.3DText","Speed","0",REG_SZ) WRITEVALUE("HKEY_CURRENT_USER\Control Panel\Screen Saver.3DText","SurfStyle","0",REG_SZ) WRITEVALUE("HKEY_CURRENT_USER\Control Panel\Screen Saver.3DText","Font","Times New Roman",REG_SZ) WRITEVALUE("HKEY_CURRENT_USER\Control Panel\Screen Saver.3DText","FontAttributes","1",REG_SZ) WRITEVALUE("HKEY_CURRENT_USER\Control Panel\Screen Saver.3DText","Charset","0",REG_SZ) WRITEVALUE("HKEY_CURRENT_USER\Control Panel\Screen Saver.3DText","Mode","1",REG_SZ) WRITEVALUE("HKEY_CURRENT_USER\Control Panel\Screen Saver.3DText","Text","BELUROKOS X",REG_SZ) WRITEVALUE("HKEY_CURRENT_USER\Control Panel\Screen Saver.3DText","Texture","C:\WINNT\WinNT.BMP",REG_SZ) ENDIF ; - WRITING VALUES IN REGISTRY CONCERNING ACTIVATION OF THE SCREENSAVER - WRITEVALUE("HKEY_CURRENT_USER\Control Panel\Desktop","ScreenSaveActive","1",REG_SZ) IF @USERID = "BELUROKOS-COMCEN" WRITEVALUE("HKEY_CURRENT_USER\Control Panel\Desktop","ScreenSaverIsSecure","0",REG_SZ) ELSE WRITEVALUE("HKEY_CURRENT_USER\Control Panel\Desktop","ScreenSaverIsSecure","1",REG_SZ) ENDIF WRITEVALUE("HKEY_CURRENT_USER\Control Panel\Desktop","ScreenSaveTimeOut","900",REG_SZ) WRITEVALUE("HKEY_CURRENT_USER\Control Panel\Desktop","SCRNSAVE.EXE","C:\WINNT\SYSTEM32\sstext3d.scr",REG_SZ) sleep 1 ;---------------------------------------- ; UPDATE Norton AntiVirus IF NECESSARY ! ;---------------------------------------- ;**** Norton Antivirus definitions update ;$UpdateFile = "0321" + "i32.exe" AT (8,5) "3. Checking your Norton AntiVirus Definition Files ..." $result = exist("c:\program files\navnt\updates\$updatefile") if $result=0 COLOR R+/b AT (9,5) " Updating your Norton AntiVirus ..." Shell 'CMD /C del "c:\program files\navnt\updates\?????????????i32.exe" /Q >nul' SHELL 'CMD /C xcopy "\\G20220S0003\netlogon\$updatefile" "c:\program files\navnt\updates\" >nul' Shell 'CMD /C "c:\program files\navnt\updates\$Updatefile" /Q' AT (10,5) " Update Terminated !" COLOR w/b else AT (10,5) " Definition Files need No Update !" endif SLEEP 1 ;* End Update Norton AntiVirus * ;******************************* ;********************************** ;------------------------- ; MAPPING TO SERVER SHARES ;------------------------- ; AT (11,5) "4. Connecting to your Network Directories ..." AT (12,5) "" ; ;MAPPING TO BELUROKOS COMMON FOLDERS ;----------------------------------- USE I: /DEL USE X: /DEL USE Y: /DEL USE F: /DEL USE G: /DEL USE P: /DEL USE H: /DEL USE H: "\\G20220S0004\@USERID" USE Z: "\\G20220S0003\BELUROKOS-NH-COMMON" ; ;SLEEP 5 ; MAPPING TO GROUPS COMMON FOLDER ;-------------------------------- IF INGROUP("Group-CieB") USE X: "\\G20220S0003\CieB-Common" ENDIF IF INGROUP("Group-CieC") USE X: "\\G20220S0003\CieC-Common" ENDIF IF INGROUP("Group-CieA") USE X: "\\G20220S0003\CieA-Common" ENDIF IF INGROUP("Group-CieM") USE X: "\\G20220S0003\CieM-Common" ENDIF IF INGROUP("Group-CieL") USE X: "\\G20220S0003\CieL-Common" ENDIF AT (12,5) "5. Connecting to your Network Printer ..." AT (13,5) "" ;**************************************************** ;---------------------------- ; MAPPING TO NETWORK PRINTER ;---------------------------- ;$Result = AddPrinterConnection("\\G20220S0004\Minolta_NH_") ;--------------------------------------- ; SET NETWORK PRINTER IN SRT AS DEFAULT ;--------------------------------------- ;IF INGROUP("Group-LocalPrt-Users") ; $state = "IN" ;ELSE ; $state = "OUT" ;ENDIF ;IF $state = "OUT" ;$Result = SetDefaultPrinter("\\G20220S0004\Minolta_NH") ;ENDIF $Result = DELPRINTERCONNECTION("\\G20220S0004\Minolta_NH") $Result = DELPRINTERCONNECTION("\\G20220S0004\Minolta_Log") ;------------------------------------------ ; SET DEFAULT PRINTER FOR GROUP OPS AND LOG ;------------------------------------------ IF INGROUP("Group-LocalPrt-CieABM") ;$Result = AddPrinterConnection("\\@DOMAINS0004\Minolta_NH") $Result = AddPrinterConnection("\\G20220S0004\Minolta_NH") ;$Result = SetDefaultPrinter("\\G20220S0004\Minolta_NH") ENDIF IF INGROUP("Group-LocalPrt-Log") $Result = AddPrinterConnection("\\G20220S0004\Minolta_Log") ;$Result = SetDefaultPrinter("\\G20220S0004\Minolta_Log") ENDIF ;******************************************** AT (13,5) "6. Profiling your Outlook ..." CALL OL98PRF.SCR ;**************************** ; E N D O F F I L E .SCR ;****************************
Autres extraits de codes en Winbatch
Version en cache
22/12/2024 23:22:41 Cette version de la page est en cache (à la date du 22/12/2024 23:22:41) afin d'accélérer le traitement. Vous pouvez activer le mode utilisateur dans le menu en haut pour afficher la dernère version de la page.Document créé le 05/10/2009, dernière modification le 28/10/2018
Source du document imprimé : https://www.gaudry.be/sniplet-rf-misc/Logon.scr.html
L'infobrol est un site personnel dont le contenu n'engage que moi. Le texte est mis à disposition sous licence CreativeCommons(BY-NC-SA). Plus d'info sur les conditions d'utilisation et sur l'auteur.