0

I have a excel file which has a button in it. if i click on the button,i should be able to open a file "myfile.exe" in an ADMINISTRATOR mode which is in different location.

could someone please help me how this could be implemented using excel VBA in Windows07 machine...?

Thanks in advance....

Community
  • 1
  • 1
Jagannath Ks
  • 477
  • 2
  • 6
  • 7

1 Answers1

0

Yes you can do it using runas but you need to have the password for it.

Shell "runas /profile /env /user:=<UserName>\admin ""c:\windows\Notepad.exe"""

SNAPSHOTS

Help on RunAs: type runas/? in DOS prompt to see the syntax.

enter image description here

Siddharth Rout
  • 147,039
  • 17
  • 206
  • 250