excel vba - VBA run shell command with admin privileges -


i need run "powercfg -hibernate off" admin privileges in order able put computer sleep (instead of hibernate). feasible? if so, how can it?

function dosleep()     shell "powercfg -hibernate off" #this needs admin privileges     shell "c:\windows\system32\rundll32.exe powrprof.dll,setsuspendstate 0,1,0"     shell "powercfg -hibernate on"  #this needs admin privileges end function 


Comments

Popular posts from this blog

symfony - InvalidConfigurationException in SecurityExtension.php line 429: No authentication listener registered for firewall "secured_area" -

angular ui router - 10 digest iterations reached in angularjs when using $state.go -

javascript - Can Piwik report referrer in real time? -