Home » Infrastructure » Windows » cmd.exe with administrator privileges (Window 7 & 8, server 2012)
cmd.exe with administrator privileges [message #608836] Tue, 25 February 2014 06:18 Go to next message
John Watson
Messages: 4609
Registered: January 2010
Location: Global Village
Senior Member
This is perhaps out of scope, if anyone objects please say so.

I'm developing a configuration tool for the database and ASM, releases 11.2 and 12.1. The problem I'm hitting is that I need to do some things with Windows Administrator privileges, such as running the asmtool.exe or the net start utility. I really don't care whether I invoke these directly, or through a shell script, or by launching a cmd.exe shell.

But I cannot find a way to do this. Googling around for days and trying Windows support sites just comes up with variations on "right-click the file and choose 'run as administrator' " which is not a lot of use when invoking stuff through batch files or dbms_scheduler. The runas.exe utility lets you switch user, but does not seem to enable administrator privileges.

Any ideas? A commandline mechanism for gaining what Windows calls "elevated privileges" so that I can run asmtool.exe?

All insight gratefully received.

Re: cmd.exe with administrator privileges [message #608837 is a reply to message #608836] Tue, 25 February 2014 06:31 Go to previous messageGo to next message
Littlefoot
Messages: 19647
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Is this what you are looking for?

./fa/11720/0/

Under Accessories, right-click CMD and from the menu select "Run as administrator".

[Updated on: Tue, 25 February 2014 06:32]

Report message to a moderator

Re: cmd.exe with administrator privileges [message #608839 is a reply to message #608837] Tue, 25 February 2014 06:34 Go to previous messageGo to next message
John Watson
Messages: 4609
Registered: January 2010
Location: Global Village
Senior Member
Exactly - I need a way to get that privilege for, for example, a script invoked through the Scheduler (and yes, I have run the Scheduler job with credentials for an administrator user, but that doesn't give the elevated privilege).
Re: cmd.exe with administrator privileges [message #608840 is a reply to message #608839] Tue, 25 February 2014 06:54 Go to previous messageGo to next message
Littlefoot
Messages: 19647
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Did you read How can I test effective permissions of a user from a batch script? (see "@Lizz"). Does it help?
Re: cmd.exe with administrator privileges [message #608844 is a reply to message #608836] Tue, 25 February 2014 07:15 Go to previous messageGo to next message
Michel Cadot
Messages: 59269
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

Maybe this one will help (2nd answer):
How do you run a command as an administrator from the Windows shell?

[Updated on: Tue, 25 February 2014 07:16]

Report message to a moderator

Re: cmd.exe with administrator privileges [message #608845 is a reply to message #608840] Tue, 25 February 2014 07:16 Go to previous message
John Watson
Messages: 4609
Registered: January 2010
Location: Global Village
Senior Member
Thank you for that, it works: after a bit of hacking, I can run the asmtool.exe successfully through that PowerShell command. Now I have to work out why it works, so I can configure it for myself.

How come I spend days on Microsoft sites and get nowhere, then get a pointer to the answer in minutes on OraFAQ? Perhaps we should all set up as Windows consultants.

Thank you again.
Previous Topic: ORA-12500 TNS:listener failed to start a dedicated server process?
Next Topic: how to put current date and time in dump file using expdp utility in windows
Goto Forum:
  


Current Time: Tue Sep 30 02:22:53 CDT 2014

Total time taken to generate the page: 0.06031 seconds