vnavna Posted October 29, 2007 Share Posted October 29, 2007 Is there any way to postpone the screen saver until after a long script may run? I have put in some simple refresh commands of sending a simple Send ("#d {F5 2}"). Is there any other way? Link to comment Share on other sites More sharing options...
Blue_Drache Posted October 29, 2007 Share Posted October 29, 2007 Move the mouse. Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache Link to comment Share on other sites More sharing options...
vnavna Posted October 29, 2007 Author Share Posted October 29, 2007 Don't worry I got it figured out. All I did was run a file at the start of the script consisting of the following RunWait(@ComSpec & " /c " & "regedit -s \\UNC Path\screesaveroff.reg","",@SW_HIDE) Inside of the reg file is the following. Windows Registry Editor Version 5.00 [HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\Control Panel\Desktop] "ScreenSaveActive"="0" And when the script finishes I run another RunWait(@ComSpec & " /c " & "regedit -s \\UNC Path\screesaveron.reg","",@SW_HIDE) Windows Registry Editor Version 5.00 [HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\Control Panel\Desktop] "ScreenSaveActive"="1" This seems to work. This is going to work for me because my settings are getting deployed through a Group Policy. if you don't use a GPO you have to go to a different place in the registry. HKEY_CURRENT_USER\Control Panel\Desktop and make your changes. Link to comment Share on other sites More sharing options...
Joon Posted October 29, 2007 Share Posted October 29, 2007 Registry import don't have immediate action. Here is another way... #include <A3LWinAPI.au3> ;~ Disable _API_SystemParametersInfo($SPI_SETSCREENSAVEACTIVE,0,0,$SPIF_UPDATEINIFILE) ConsoleWrite('ScreenSaveActive: ' & RegRead('HKEY_CURRENT_USER\Control Panel\Desktop','ScreenSaveActive') & @LF) ;~ Enable _API_SystemParametersInfo($SPI_SETSCREENSAVEACTIVE,1,0,$SPIF_UPDATEINIFILE) ConsoleWrite('ScreenSaveActive: ' & RegRead('HKEY_CURRENT_USER\Control Panel\Desktop','ScreenSaveActive') & @LF) Link to comment Share on other sites More sharing options...
vnavna Posted October 29, 2007 Author Share Posted October 29, 2007 I will give that a try. THX Link to comment Share on other sites More sharing options...
zfisherdrums Posted October 29, 2007 Share Posted October 29, 2007 (edited) Hello vnavna, I banged my head against this very issue last week. Problem is, our screen saver settings are deployed via Group Policies and I'm unable to locate [HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\Control Panel\Desktop] from my non-admin account (GO SECURITY!). From my understanding of the TechNet documentation, group policy trumps "HKEY_CURRENT_USER\Control Panel\Desktop" settings such that I can disable my screen saver registry settings all day long, but the group policy settings will always win out. Has this been your experience as well? I'm not looking to hack around it, but I couldn't disable the screensaver using any non-admin reg settings I could find. Perhaps I'm misunderstanding all this ( wouldn't be the first time ). Thanks, Zach... Edited October 29, 2007 by zfisherdrums Identify .NET controls by their design time namesLazyReader© could have read all this for you. Unit Testing for AutoItFolder WatcherWord Doc ComparisonThis here blog... Link to comment Share on other sites More sharing options...
vnavna Posted October 29, 2007 Author Share Posted October 29, 2007 The only option that I really know of is to use the third party app called LSRUNAS from http://www.moernaut.com/default.aspx?item=lsrunaseInstead of sending everything in clear text in encrypts the password. I have used it before and it works nicely. Link to comment Share on other sites More sharing options...
Blue_Drache Posted October 29, 2007 Share Posted October 29, 2007 Don't worry I got it figured out. All I did was run a file at the start of the script consisting of the following RunWait(@ComSpec & " /c " & "regedit -s \\UNC Path\screesaveroff.reg","",@SW_HIDE) Inside of the reg file is the following. Windows Registry Editor Version 5.00 [HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\Control Panel\Desktop] "ScreenSaveActive"="0" Why use a .reg file? Why not use RegRead and RegWrite Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache Link to comment Share on other sites More sharing options...
vnavna Posted October 29, 2007 Author Share Posted October 29, 2007 Can that be ran under a non-admin person? Link to comment Share on other sites More sharing options...
Blue_Drache Posted October 29, 2007 Share Posted October 29, 2007 I don't know....I don't run a non-admin account. Try it with your computer and see what happens. Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache Link to comment Share on other sites More sharing options...
Joon Posted October 29, 2007 Share Posted October 29, 2007 (edited) Here is the trick with Policy... Read Screen Saver timeout value from the registry and just enable the ScreenSaver again before it times out. This will reset the Screen Saver timer. You have to use API call like my above post. Edited October 29, 2007 by Joon Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now