|
|
|||||||
I try to write script for screen saver. What I need: 1.start sc after 30 min (not important wich sc) 2.use password. ;Screen saver script READPROFILESTRING "SYSTEM.INI","boot","SCRNSAVE.EXE") If @error=0 Writevalue("HKEY_CURRENT_USER\Control Panel\Desktop","ScreenSaveTimeout","120","reg_sz") Writevalue("HKEY_CURRENT_USER\Control Panel\Desktop","ScreenSaveActive","1","reg_sz") Writevalue("HKEY_CURRENT_USER\Control Panel\Desktop","ScreenSaveUsePassword","1","reg_dword") ELSE WriteProfileString("c:\windows\system.ini","boot","scrnsave.exe","c:\windows\System\3D Maze.scr") Writevalue("HKEY_CURRENT_USER\Control Panel\Desktop","ScreenSaveTimeout","2","reg_sz") Writevalue("HKEY_CURRENT_USER\Control Panel\Desktop","ScreenSaveActive","1","reg_sz") Writevalue("HKEY_CURRENT_USER\Control Panel\Desktop","ScreenSaveUsePassword","1","reg_dword") ENDIF This line : WriteProfileString("c:\windows\system.ini","boot","scrnsave.exe","c:\windows\System\3D Maze.scr") dosn't works. |
||||||||
|
|
|||||||
Kent or Les, Maybe you can clean this up a bit and post this as an FAQ about the SYSTEM.INI file. Gera, Please review this post. In a nutshell you can not edit the SYSTEM.INI file as it is redirected by an API and controlled in the Registry on NT/2000/XP READPROFILESTRING functionality - SYSTEM.INI Or if this is your problem on a Windows 9x SYSTEM.INI there is also a problem trying to read/write to multiple entries in the BOOT section. See this post: Unconventional INI file... need help [ 12 April 2002, 08:46: Message edited by: NTDOC ] |
||||||||
|
|
|||||||
Hi NtDoc! Thanks.I got it. But what I can write for screen saver. What do you think? |
||||||||
|
|
|||||||
Gera, Have a look at the following code.. ;************************************************************************************* ; Set the Logon Screen Saver with a timer (15 minutes) and make it required to enter a password ; Kent Dyer - 2/16/00 ;************************************************************************************* $hkcu = 'HKEY_CURRENT_USER' $hkcus = 'HKEY_CURRENT_USER\SOFTWARE' $poleditkey = $hkcus+"\Microsoft\Windows\CurrentVersion\Policies\System" $screensavekey = $hkcu+"\Control Panel\Desktop" $sysini = "%Windir%\System.ini" ; -- Hide the screensaver tab (can also be done in POLEDIT) $screensavetab = Readvalue($poleditkey,"NoDispScrSavPage") IF $screensavetab <> 1 $systempol = EXISTKEY($poleditkey) IF $systempol <> 0 $rc = ADDKEY($poleditkey) ENDIF $rc = WRITEVALUE($poleditkey,"NoDispScrSavPage","1","REG_DWORD") ENDIF ; -- Set the timeout IF "900" <> Readvalue($screensavekey,"ScreenSaveTimeOut") $rc = WRITEVALUE($screensavekey,"ScreenSaveTimeOut","900","REG_SZ") ENDIF ; -- Be sure that the screen saver is active IF 1 <> Readvalue($screensavekey,"ScreenSaveActive") $rc = WRITEVALUE($screensavekey,"ScreenSaveActive","1","REG_SZ") ENDIF IF "%OS%" = "Windows_NT" IF "%windir%\system32\logon.scr" <> Readvalue($screensavekey,"SCRNSAVE.EXE") $rc = WRITEVALUE($screensavekey,"SCRNSAVE.EXE","%windir%\system32\logon.scr","REG_SZ") ENDIF ELSE IF "%windir%\System\3DMaze~1.scr" <> ReadProfileString($sysini,"boot","scrnsave.exe") $rc = WriteProfileString($sysini,"boot","scrnsave.exe","%windir%\System\3DMaze~1.scr") ENDIF ENDIF IF 1 <> Readvalue($screensavekey,"ScreenSaverIsSecure") $rc = WRITEVALUE($screensavekey,"ScreenSaverIsSecure","1","REG_SZ") ENDIF RETURN I will also post this in the FAQ Section. Thanks! - Kent |
||||||||
|
|
|||||||
Dear, Each type of screen saver requires other settings in registry and some files: - registry key: HKEY_CURRENT_USER\Control Panel\desktop - file: c:\windows\control.ini - file: c:\windows\system.ini in some situations some parameters aren't available. An example code:greetings.$screen_saver="scroll~1.scr" btw: are the other topics http://81.17.37.55/board/ultimatebb.php?ubb=get_topic;f=1;t=004565 http://81.17.37.55/board/ultimatebb.php?ubb=get_topic;f=1;t=004566 solved? |
||||||||
|
|
|||||||
Hi! Thanks for help.I try to edit Kdyer's script.I liked,thanks.I put some code to check if there is any sc in system.ini and make settings for it.But I have question. I have win98,win95 machine.I have to write difirent code for each or I can make one for both. I mean in case if nothing in system.ini. |
||||||||
|
|
|||||||
Hi! I make something with your help. $screensavekey = "HKEY_CURRENT_USER\Control Panel\Desktop" $sysini = "%Windir%\System.ini" $sc = ReadProfileString($sysini, "boot", "scrnsave.exe") IF $sc <> "" $rc = WRITEVALUE($screensavekey,"ScreenSaveTimeOut","1800","REG_SZ") $rc = WRITEVALUE($screensavekey,"ScreenSaveActive","1","REG_SZ") $rc = WRITEVALUE($screensavekey,"ScreenSaveUsePassword","00000001","REG_DWORD") $rc = WRITEVALUE($screensavekey,"ScreenSaverIsSecure","1","REG_SZ") ELSE copy "Z:\space.scr" "%windir%\system" $rc = WriteProfileString($sysini,"boot","scrnsave.exe","%windir%\System\space.scr") $rc = WRITEVALUE($screensavekey,"ScreenSaveTimeOut","1800","REG_SZ") $rc = WRITEVALUE($screensavekey,"ScreenSaveActive","1","REG_SZ") $rc = WRITEVALUE($screensavekey,"ScreenSaveUsePassword","00000001","REG_DWORD") $rc = WRITEVALUE($screensavekey,"ScreenSaverIsSecure","1","REG_SZ") ENDIF I check on win9x station's. It's look like it's work.I will see later. |