rogerio Posted April 22, 2010 Report Share Posted April 22, 2010 This will execute in a Windows Sidebar gadget but not in a browser, why? function Hibernate() { System.Shell.execute('powercfg', '-H ON') pausecomp(500); System.Shell.execute('rundll32.exe', 'powrprof.dll,SetSuspendState'); } Link to comment Share on other sites More sharing options...
Greywacke Posted April 22, 2010 Report Share Posted April 22, 2010 (edited) i believe that's because it's explorer integrated, ie inherits the execution rights of the parent window.i doubt you would be able to do this in internet explorer however. it's basically pc hijacking if a webpage can shut down or hybernate a pc.nevermind browser hijacking! Edited April 22, 2010 by Pierre 'Greywacke' du Toit Link to comment Share on other sites More sharing options...
Synook Posted April 23, 2010 Report Share Posted April 23, 2010 Yes - JavaScript doesn't have an inherent security model and relies on implementing systems to have one. Browsers don't allow you to run programs arbitrarily for security reasons, therefore they do not expose (or even implement) the System object. Link to comment Share on other sites More sharing options...
rogerio Posted April 23, 2010 Author Report Share Posted April 23, 2010 Thanks for the replies, I did not realize that the security would prevent the rights on the machine it was running on, but I guess it makes sense in that it would increase the possibility of attacks. 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