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

mysql - FireDac error 314 - but DLLs are in program directory -

git - How to list all releases of public repository with GitHub API V3 -

c++ - Getting C2512 "no default constructor" for `ClassA` error on the first parentheses of constructor for `ClassB`? -