Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


"Run as ..."

 
Logged in as: Guest
arrSession:exec spGetSession 2,7,27582
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [General Forum] >> Other Programming/Scripting Languages >> "Run as ..."
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 "Run as ..." - 10/31/2005 1:01:06 AM   
  CondorMan

 

Posts: 11
Score: 0
Joined: 10/5/2005
Status: offline
Hi everyone

I have XP Pro SP2 and have a few scripts which work fine.  If I try to use them when logged on with Limited Rights (I do this out of habit, rather than using the computer on a day-to-day basis with Admin Rights), they often generate an error.  I think the errors are generated by the fact that the scripts are being used as a non-Administrator and the script may be doing something which a non-Administrator shouldn't be doing.

I know there's a "Run as ..." facility which I've tried to activate, but does this only work with programs such as MS Word, Excel etc., or can this principal be used with a .vbs file?  I suspect that I'd have to give "permission" for the .vbs to be run as an Administrator (presumably with the appropriate password) but I'm not sure how I'd do that.  I know I could simply run the .vbs whilst logged in as an Administrator, but I'd prefer to avoid this, if possible.

I know that this isn't specifically a VBS programming matter so, if necessary, I could post this problem in a more appropriate forum.  I feel that if this can be resolved here, other readers may benefit from the technique if they run into the same problem.

Thanks for your time and patience.
 
 
Post #: 1
 
 RE: "Run as ..." - 10/31/2005 4:48:20 AM   
  mbouchard


Posts: 1906
Score: 14
Joined: 5/15/2003
From: USA
Status: offline
Do a search in the VBscript discussion forum for RunAs and you will find a couple scripts for using RunAs.  Alternativly, look at PSexec by www.Sysinternal.com, which allows you to call a exe,bat,cmd with elevated rights.   Also, take a look at AutoIT www.hiddensoft.com, specifically RunAsSet which will elevate the rights of anything called to a specified level.  

_____________________________

Mike

For useful Scripting links see the Read Me First stickey!

Always remember Search is your friend.

(in reply to CondorMan)
 
 
Post #: 2
 
 RE: "Run as ..." - 10/31/2005 8:47:00 PM   
  CondorMan

 

Posts: 11
Score: 0
Joined: 10/5/2005
Status: offline
That's great - thank you.  I was unaware of "runas" and had searched for "run as"!!

(in reply to mbouchard)
 
 
Post #: 3
 
 RE: "Run as ..." - 12/22/2005 8:09:13 AM   
  lonniec

 

Posts: 1
Score: 0
Joined: 12/22/2005
From: USA
Status: offline
Mike you seem to be verry well acqainted with PSexec and AutoIT.  -  I also have dabbled in these and VBscript as well.  Question about PSexec - If I start a .bat file with elevated rights, does all of the commands inside the .bat file also get run with the same elevated rights?

quote:

ORIGINAL: mbouchard

Do a search in the VBscript discussion forum for RunAs and you will find a couple scripts for using RunAs.  Alternativly, look at PSexec by www.Sysinternal.com, which allows you to call a exe,bat,cmd with elevated rights.   Also, take a look at AutoIT www.hiddensoft.com, specifically RunAsSet which will elevate the rights of anything called to a specified level.  

(in reply to mbouchard)
 
 
Post #: 4
 
 RE: "Run as ..." - 12/23/2005 1:47:22 AM   
  ebgreen


Posts: 4613
Score: 31
Joined: 7/12/2005
Status: offline
YOu could easily test it by making a bat that does something only an admin could do the run it with psexec and elevated rights. I am 99% sure that it will run just fine but I cannot remember an express instance where I have done this.

_____________________________

"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to lonniec)
 
 
Post #: 5
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [General Forum] >> Other Programming/Scripting Languages >> "Run as ..." Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts