Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8588387
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T22:47:27+00:00 2026-06-11T22:47:27+00:00

I have a very interesting problem. I use Process.Start with the runas verb to

  • 0

I have a very interesting problem.

I use Process.Start with the “runas” verb to run a process as administrator ie.

string currentstatus;
            ProcessStartInfo startInfo = new ProcessStartInfo();
            Process myprocess = new Process();
            try
            {
                startInfo.FileName = "cmd"; //
                startInfo.Verb = "runas";
                startInfo.Arguments = "/env /user:" + "Administrator" + " cmd";
                startInfo.RedirectStandardInput = true;
                startInfo.RedirectStandardOutput = true;
                startInfo.UseShellExecute = false; //'required to redirect
                startInfo.CreateNoWindow = true; // '<---- creates no window, obviously
                myprocess.StartInfo = startInfo; //
                myprocess.Start(); //
                System.IO.StreamReader SR;
                System.IO.StreamWriter SW;
                Thread.Sleep(200);
                SR = myprocess.StandardOutput;
                SW = myprocess.StandardInput;
                SW.WriteLine(commandexecuted); // 'the command you wish to run.....
                SW.WriteLine("exit"); // 'exits command prompt window
                Thread.Sleep(200);
                currentstatus = SR.ReadToEnd();

                SW.Close();
                SR.Close();

            }
            catch (Exception e)
            { }

Which said to have command executed is given as

exp *****/******@!!!!!!! owner =!!!!!!!! file =D:/SS.dmp

now my problem is

1) when i run the above query manually by right clicking the cmd.exe and choose “Run as administrator ” it works fine but with out it it throws me the error

2) so i need to execute that process through code.

i do not know where i went wrong?

is this only the way to take oracle dump or else it might be having some other way?

waiting for your valuable response and comments…..

updated 1)

I too use this code to check whether the current user is administrator or not through

    private static bool IsAdministrator()
{
    WindowsIdentity identity = WindowsIdentity.GetCurrent();
    WindowsPrincipal principal = new WindowsPrincipal(identity);
    return principal.IsInRole(WindowsBuiltInRole.Administrator);
}

it returned me as the current user is only a administrator.

any sugessions for my above problem !

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T22:47:28+00:00Added an answer on June 11, 2026 at 10:47 pm

    Since runas was useless, try embedding an application manifest

    <requestedExecutionLevel level="requireAdministrator" uiAccess="false" /> 
    

    That should work, anyway you always have the handy:

    myprocess.StartInfo.UserName = "Administrator"; 
    myprocess.StartInfo.Password = "password"; 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a very interesting problem. I use this technologies in WPF app: Caliburn.Micro
Here is one very interesting problem. I am using SQL Server 2008. I have
I have came across very interesting problem which I think it's on Salesforce's end
I have came across a very interesting problem. I have a UILabel and a
I have run into an interesting problem lately: Lets say I have an array
I am facing a very interesting problem. I have tested the Delay job gem
I have run into a very interesting situation. I have access to two devices
I found a very interesting/strange thing about MAX() function in SQL. I have column
I've seen jint in Codeplex. It looks very interesting. Have you used it? Is
i have very serious problem if any tech expert can help...thank you in advance..

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.