Create Run as admin / Run as Program?

I want to create a windows application which contains 2 buttons Called
1). Run
2). Run As Admin
Now I want to open my visual studio using the above two buttons
and I have hard codded the Admin UID and PWD in my code and while clicking Run as admin it should open my Visual studio with admin rights.
and when I click Run it should open as normal
My current login is normal user only and I have Admin UID and pswd and I am using VS 2012.
Your early response it could be very help full.
Thanks in advance.
By
A Path finder
JoSwa
If a post answers your question, please click "Mark As Answer" on that post and "Mark as Helpful"
Best Online Journal

Hi Jo,
Try to P/Invoke CreateProcessWithLogonW function:
https://msdn.microsoft.com/en-us/library/windows/desktop/ms682431%28v=vs.85%29.aspx?f=255&MSPPError=-2147217396
Or try to impersonate the windows identity:
http://blogs.msdn.com/b/saurabhkv/archive/2008/05/29/windowsidentity-impersonation-using-c-code.aspx
But it's not recommended to hard code the username and password in your application because of the security problem. Others
may retrieve the credential information by the application configuration file or assembly file. It's more safe to prompt the UAC for the user.
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey.

Similar Messages

  • When running setup, I get"This file does not have a program associated with it for performing this action. Please install a program or, if one is already installed, create an association in the Default Programs control panel.

    whe I try to install Firefox 4.0.1, I get a Red X message. ""This file does not have a program associated with it for performing this action. Please install a program or, if one is already installed, create an association in the Default Programs control panel. Is there a fix?

    I Did that. When I try to install, I get the same message. I have come to believe this is a windows 7 or IE 9 problem. I also have active X problems that I can not resolve. I can not open Gmail also

  • /SAPAPO/SDRQCR21 program is not working correctly if we run the program for range of material and plant wise

    Hi APO Experts,
    In our project, we have received more sales order inconsistencies which is not clearing by CCR program and it is clearing by  program /SAPAPO/SDRQCR21 with option as Build Reqmts from Doc. Flow, So We have decided to schedule the background job on daily basis for program /SAPAPO/SDRQCR21 with option as Build Reqmts from Doc. Flow, performing the testing in our quality system and observed the below strange behavior. 
    When I am running the program /SAPAPO/SDRQCR21 with Range of products and some location range with option as Build Reqmts from Doc. Flow, in Background job. In output it is suggesting to delete one sales order. If I checked that Sales order in ECC, it is for an different location, that is not part of my selection and the order is open. In MD04 the Qty is showing 1 ( as per sales order) but in APO RRP3 view the order qty is showing Zero. I have run the CCR, it is coming in different in content and if I push, the different is not going to APO.
    I have tried running the program /SAPAPO/SDRQCR21 with plant which is mentioned in that sales order with option as Build Reqmts from Doc. Flow, in Background job , it is suggesting this sales order under update option correctly.   
    Can you please help me understand why it is behaving differently like the location is not part of my selection and why it is suggesting the wrong action. And also whether is it advisable to run the /SAPAPO/SDRQCR21 with option as Build Reqmts from Doc. Flow at plant range and material range in background job.
    Thanks & Regards,
    Sundaram Radhakrishnan

    Sundaram,
    It sounds to me like the sales document records in the OLTP and in APO were created at different times.  This is common in Dev and Qual environments when the systems are commonly created at two different times, and each was a copy of an existing system that contained sales data.  The order number you see in //rrp3 is somewhat irrelevant; system generally uses the guid for many activities.
    FYI during Dev and Qual refreshes, if you are copying from a production environment that contains data, it is always best to create the OLTP and SCM images at the same time, and to copy them both to the Dev and Qual systems at the same time.  If you don't do this, you are faced with the additional tasks associated with getting the copied systems back into synch.
    If this is Dev or Qual, I suggest that you just completely wipe out all sales orders in APO and rebuild them using the CIF.
    If this is a mature production environment, the only time I have ever seen this issue is due to improperly created CIF enhancements.  Speak to your developers to find the root cause, and correct this problem.  Then, wipe out all sales orders and rebuild with CIF.
    Best Regards,
    DB49

  • Error in running the Program SDRQCR21

    Hi,
    For a material,the sales order which are rejected are showning in MD04.When i try to run this program
    SDRQCR21,it gives me timed out error.
    Since there are lot of sales order for that material.
    Please can any one help me in this issue...
    Thanks
    Srini

    Hi,
    If we run the program,is the orders which are rejected gets deleted or any other scenario like delivery not created for the order etc will also get deleted from the MD04.
    Please clarify on this issue.
    Thanks
    Srini

  • Error while running jms program in eclipse

    Hi,
    Friends.I am new to forum.This is the first question I am posting.I am new to Java Messaging service.While running the program in eclipse I am getting the following error...
    javax.jms.JMSException: MQJMS2005: failed to create MQQueueManager for 'scsstasdap03:QSEIBEL'
         at com.ibm.mq.jms.services.ConfigEnvironment.newException(ConfigEnvironment.java:569)
         at com.ibm.mq.jms.MQConnection.createQM(MQConnection.java:2328)
         at com.ibm.mq.jms.MQConnection.createQMNonXA(MQConnection.java:1749)
         at com.ibm.mq.jms.MQQueueConnection.<init>(MQQueueConnection.java:144)
         at com.ibm.mq.jms.MQQueueConnection.<init>(MQQueueConnection.java:54)
         at com.ibm.mq.jms.MQQueueConnectionFactory.createQueueConnection(MQQueueConnectionFactory.java:106)
         at com.bofa.pbes.cedapi.cmwmq.JMSManager.<init>(JMSManager.java:87)
         at com.bofa.pbes.cedapi.cmwmq.JMSManager.<clinit>(JMSManager.java:40)
         at com.bofa.pbes.cedapi.cmwmq.JMSCEDAgent.<init>(JMSCEDAgent.java:24)
         at com.bofa.pbes.cedapi.cmwmq.MessageProcessingController.<init>(MessageProcessingController.java:34)
         at com.bofa.pbes.cedapi.cmwmq.MessageProcessingController.<clinit>(MessageProcessingController.java:38)
    java.lang.ExceptionInInitializerError
    Caused by: java.lang.NullPointerException
         at com.bofa.pbes.cedapi.cmwmq.JMSManager.addMessageListener(JMSManager.java:173)
         at com.bofa.pbes.cedapi.cmwmq.JMSCEDAgent.<init>(JMSCEDAgent.java:25)
         at com.bofa.pbes.cedapi.cmwmq.MessageProcessingController.<init>(MessageProcessingController.java:34)
         at com.bofa.pbes.cedapi.cmwmq.MessageProcessingController.<clinit>(MessageProcessingController.java:38)
    Exception in thread "main"
    Please help me.....

    Have a look in eclipse in the menu under window -> preferences -> java -> installed jre's which one is selected there.
    Than you have to check you project settings: right click on the project and select properterties. Check "Java Build Path" and "Java Compiler" settings.
    If you run your program, the console also shows the version you are running. If it is an 1.6 version everything should work.

  • I am not able to run a program,please help?

    hi everybody,
    i am getting run time error when trying to run this program, what's the wrong with that
    i copied the mysql( mysql-connector-java-5.1.11-bin.jar) driver to the following:
    C:\Program Files\Java\jre1.6.0_05\lib\ext
    here is the code:
    import java.sql.*;
    public class Jdbc11 {
    public static void main(String args[]){
    System.out.println(
    "java with mysql");
    try {
    Statement stmt;
    Class.forName("com.mysql.jdbc.Driver");
    String url ="jdbc:mysql://localhost:3306/mysql";
    Connection con = DriverManager.getConnection(url,"root", "555");
    System.out.println("URL: " + url);
    System.out.println("Connection: " + con);
    stmt = con.createStatement();
    stmt.executeUpdate("CREATE DATABASE JunkDB");
    stmt.executeUpdate(
    "GRANT SELECT,INSERT,UPDATE,DELETE," +
    "CREATE,DROP " +
    "ON JunkDB.* TO 'auser'@'localhost' " +
    "IDENTIFIED BY 'drowssap';");
    con.close();
    }catch( Exception e ) {
    e.printStackTrace();
    }//end catch
    }//end main
    }//end class Jdbc11
    the error:
    C:\New Folder>java Jdbc11
    Exception in thread "main" java.lang.NoClassDefFoundError: Jdbc11
    Caused by: java.lang.ClassNotFoundException: Jdbc11
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClassInternal(Unknown Source)

    This is a sub-optimal solution. Renaming a jar file to remove version information can cause problems later. How will you know the version for which you check documentation, bugs, etc? Also, the root directory of your file system is not the best place to put java archive files. It can get pretty crowded for a complex application. I suggest you create, for your project, some directory where third-party jar files can maintained. We do this for each project.
    {?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • OS command syntax to run RPG program (FTP Adapter)

    Hi All,
    I try to run RPG program from File Adapter OS command, I do not know correct OS syntax.
    RPG program will create sales order in JD, PI and JD is on IBM i5 OS.
    I am able to run OS command like "mkdir" but i do not know correct syntax to run RPG program.
    I try few OS command but doesn't work like:
    CALL PGM(Library Name/Program Name) PARM(xx,yyy,zzz)
    CALL Library Name.Progran Name(param)
    With regards
    Sunil

    Hi,
    Please check with the link:
    https://www.sdn.sap.com/irj/scn/wiki?path=/display/xi/morewiththeFileAdapter
    Hope it will throw some light to your solution.
    Thanks.
    Regards,
    Vineetha.

  • Run a Program RFF110S for Automating Payment Program

    Hi Gurus,
    I am trying to use a program RFF110S to automate outgoing payments. Please help me with the steps or the process of setting up or schedulding the auto payment program at regular intervals.
    Also I know that this program is a alternative to use the transaction F110, if anybody know to use it I would appreciate your help.
    Thanks in Advance.
    Best Regards.

    The following reports helps you to schedule a Payment Program :
    - RFF110S  - for the Automatic Scheduling of the Payment Program
    - SAPF110S - Here you have to enter the Run ID and Run Date and specify
                 Proposal or Payment and look for the following options :
                 Menu Options -> Program -> Execute in Background.
    Kindly review the documentation of the program RFF110S through SE38 -> Dcoumentation -> F7.
    Report RFF110S essentially offers the same parameters as are available in transaction F110.
    Once you have defined a variant for the report you can schedule it in the background. By using selection variables for the date field in the variant you can periodically create runs with identical parameters.
    You can use SELECTION VARIABLES for the date fields of your selection screen variant.
    SAP Library:
    http://help.sap.com/saphelp_nw70/helpdata/en/c0/980374e58611d194cc00a0c94260a5/frameset.htm
    The periodic scheduling can be done either using job administration or the Schedule Manager.
    I suppose this should be able to satisfy your requirement.
    Best Regards
    Soumya

  • Problem running my program only after making an executable jar...

    Hi everyone,
    I am having trouble running my program after creating an executable jar. The program runs fine until
    it is supposed to open a specific JFrame. I get the following error message as soon as the frame tries
    to open:
    Exception in thread "AWT-EventQueue-0" java.lang.NoSuchMethodError: org.apache.xerces.parsers.SAXParser.<init>(Lorg/apache/xerces/xni/parser/XMLParserConfigurat
    ion;
    Has anyone ever seen this before?
    The strange thing is, this does not happen when I build and run the project under Eclipse.
    Any help or tips would be appreciated!
    Chris

    Roosh wrote:
    The strange thing is, this does not happen when I build and run the project under Eclipse.
    Any help or tips would be appreciated!Make sure you are using the same version of Java as you use with Eclipse.

  • Is there any way to run abap program in dialog process with process chain?

    Hi.
    I just want to run custom abap program in every 30min.
    so I made process chain and connect abap program.
    but it returns NOTHING when background running.
    the program has ABSOLUETLY no problem when it's running DIALOG process.
    custom program is modified from sap standard program for my use.
    so complicated and hard to read that I cann't figure out what's problem in backgound job and even hard to debug in background process.
    is there any way to run abap program in dialog process in every 30 min.?
    or call BSP page or call function.
    any solution will be helpful that excuting PROGRAM or FUNCTION or BSP PAGE in schedule job and should running dialog process.
    thanks.
    Lee.

    Hi,
    did you try using sm36 transaction?
    1Give these values in Gereral data
    Create one sample job "SAMPLE JOB"
    Priority "A"
    Execu target - Your application server
    2Click start conditon
    schedule according to ur requirements.
    3.Click Step button
    Give your ABAP program name.
    fill variants if it has any variants.
    if it is useful assign points
    Regard,
    Senthil Kumar.P

  • GPO Run these programs at user logon not taking effect when configured in Computer Configuration section

    [EDIT 20140207]:
    I found that the default domain policy sets "run these programs at user logon" and (other than I expected) not BOTH GPO settings become active, but the setting from the default domain policy overrides the setting from my new GPO. So I think I have
    found the answer myself.
    When on our W2k8-R2 DC I create a new GPO and configure
    "Computer Configuration/Policies/Windows Settings/Administrative Templates/System/Logon/run these programs at user logon" to "c:\windows\system32\notepad.exe" (just for testing) it won't take effect on Win 7 SP1, no matter what the Security
    Filtering options are.
    It seems other settings (in the very same GPO) become active but "run these programs at user login" from the computer policies section doesn't. I configure the very same setting in the section "user policies" instead and add "Authenticated
    Users" to Security Filtering, the program will be started. But that's not what I need.
    I can reproduce the issue, here are the exact steps:
    create a new group "group-a" for later security filtering
    create a new GPO
    in the new GPO set "Computer Configuration/Policies/Windows Settings/Administrative Templates/System/Logon/run these programs at user logon" to "c:\windows\system32\notepad.exe"
    for setting the scope remove "authenticated users" from Security Filtering and add "group-a" instead
    link the GPO to the domain root
    make "test computer" a member of "group-a"
    on "test computer" run "gpupdate /force", reboot, log in
    Issue: notepad is not being started.
    What I'm aiming for is obvious: Depending on the membership of group-a I want to configure certain programs that should be started whenever a user logs in.
    gpresult /R returns that it would be applying the GPO. (It actually is but the setting "run these programs at user login" is not being applied.)
    For debugging I started MMC / RSoP on one of the machines on which the GPO should have been applied and found that "run these programs at user login" is not set (which seems to be the reason why the GPO won't work on the machines).
    Searching the web I found similar reports
    [1] [2] but no solution was found and the user used a workaround instead.
    If I change the GPO so that I use the very same setting in "user configuration" instead of "computer configuration" it works as long as I add "authenticated users" to the Security Filtering. But then the GPO is applied to all users
    and not only to the ones using computers which are members of group-a. According to this howto [3] I should not remove "authenticated users" but alter the security setting instead. However, the howto seems to be aimed ad w2k3 and using Win2k8 I cannot
    find security settings "apply" for "authenticated users" so I cannot remove that setting, there's only "read" or "read and modify".
    So two questions:
    1. Why doesn't it work when using "computer settings"
    2. What about that Security Filtering with removing "authenticated users" and using group-a instead?
    T.
    [1] http://social.technet.microsoft.com/Forums/windows/en-US/0e280490-fba6-4ced-aba5-ae49c60e44bd/computer-gpo-run-these-programs-at-user-logon-not-working-as-intended-on-win7-clients?forum=w7itproinstall
    [2] http://social.technet.microsoft.com/Forums/windows/en-US/8cb78bf8-33ec-461e-8604-32d82d016685/run-these-programs-at-user-logon?forum=winserverGP
    [3] http://www.grouppolicy.biz/2010/05/how-to-apply-a-group-policy-object-to-individual-users-or-computer/

    Hi,
    sounds like you find the answer already.
    If you have any further question, please feel free to let me know.
    Have a nice day!
    If you have any feedback on our support, please click
    here
    Alex Zhao
    TechNet Community Support

  • How to run TagLibrary program

    Hi frnds,
    i am working on Jsp Tag Small example ..I wrote one JSP file,One .tld file and one .java files .That java file is compiled properly.While running that program i am getting error as below:
    1..org.apache.jasper.JasperException: /Date.jsp(7,7) Unable to load tag handler class "tagexamples.PageVisitTag" for tag "test:pageVisit"
    Here with i sent my File Structure and Source file also :
    1.Date.jsp
    <%@ page language="java" import ="java.util.Date" %>
    <%@ page import="tagexamples.*" %>.
    <html>
    <title>Simple Date Tag</title>
         <body>
              <%@ taglib uri="/pageVisit.tld" prefix ="test" %>
              <h2> <test:pageVisit /></h2>
              <h2> Current System Date is <%= new Date().toString() %></h2>
         </body>
    </html>
    2.pageVisit.tld
    <?xml version="1.0" encoding ="ISO-8859-1" ?>
    <!DOCTYPE taglib PUBLIC "=//Sun.Microsystems,Inc.//DTD Jsp Tag Library 1.1//EN"
              "http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_1.dtd">
    <taglib>
         <tlibversion>1.0</tlibversion>
         <jspversion>1.1</jspversion>
         <shortname>date</shortname>
         <info>
              A simple tag Library for example
         </info>
         <tag>
              <name>pageVisit</name>
              <tagclass>tagexamples.PageVisitTag</tagclass>
              <bodycontent>empty</bodycontent>
              <info>
                   This tag Output the LastTime u have viisted the page in the Last MOnth..
                   This tag Ocntains empty Body and no attributes
              </info>
         </tag>
    </taglib>
    3.PageVisitTag.java
    package tagexamples;
    import javax.servlet.http.*;
    import javax.servlet.jsp.*;
    import javax.servlet.jsp.tagext.*;
    import java.util.Date;
    import java.io.IOException;
    public class PageVisitTag extends TagSupport
         public int doStartTag() throws JspTagException
              Cookie info = null;
              String msg = "This is the First time u have Visited this page" ;
              //Get all Cookine s that Came from the Request
              Cookie[] cookies = ((HttpServletRequest)pageContext.getRequest()).getCookies();
              for (int i=0;i< cookies.length;i++)
                   info = cookies;
                   if(info.getName().equals("MyCookie"))
                        found = true;
                        break;
              }//for
              String newValue =""+System.currentTimeMillis();
              if(!found)
                   //Create a new Cookie and set its age
                   info = new Cookie ("MyCookie",newValue);
                   info.setMaxAge(60*1);
                   info.setPath("/");
                   ((HttpServletResponse)pageContext.getResponse()).addCookie(info);
              }else {
                   long conv = new Long(info.getValue()).longValue();
                   msg = "U Last visited this site on "+new Date(conv);
                   //Set the new value of the Cookie and adddd it to the Response
                   info.setValue(newValue);
                   info.setMaxAge(10*24*60*60); //keep the cookie for One Month
                   //Set the Path so that the Cookie is available everywhere on the Server
                   info.setPath("/");
                   ((HttpServletResponse)pageContext.getResponse()).addCookie(info);
              } //else
              try{
                   JspWriter out = pageContext.getOut();
                   out.write(msg);
                   }catch(IOException e){
                        throw new JspTagException("JspWriter not There :"+e);
                   return SKIP_BODY;
         }//doStartTag ends
         public int doEndTag() throws JspTagException {
              if(!found){
                   //Don't Compare current and Cookie time this time
                   return SKIP_PAGE;
              }else {
                   return EVAL_PAGE;
         }//doEnd Tag ends
              boolean found = false;
         } //Class ends
    while running the above files in Tomcat it giving above error:
    i am running by:
    http://localhost/TagExamples/Date.jsp
    and
    I kept files in the below Structre order.
    My file Structure is :
    D:\jakarta-tomcat-5.0.16\webapps\TagExamples\WEB-INF\classess\tagexamples\PageVisitTag.java
    D:\jakarta-tomcat-5.0.16\webapps\TagExamples\Date.jsp
    D:\jakarta-tomcat-5.0.16\webapps\TagExamples\pageVisit.tld
    Just tell me is it Correct ..? and what is the Problem in COding and how to run a Tag Library
    If anybody know the Solution just reply .send me the mail
    [email protected]
    with regards,
    Ramesh P
    98459 35822

    Do (dir if on windows, ls if on *nix) and you will probably see an A directory in the A directory.  That came from your last compilation attempt.  Remove it and everything in it.  Now,
    cd ..
    javac A/Convertible.java
    java A.Convertible

  • Downloaded the pdf converter to word....how do I run the program?

    downloaded the pdf converter to word....how do I run the program?

    Hi seang449,
    Please let me know which software you purchased and for what OS? Is it Adobe Acrobat or Create PDF service?
    After downloading the software you need to run the .exe file (WIN) / .dmg file (MAC) to install the application.

  • Run java programs on computers without a SDK

    Alright. So I wrote a java program on my computer. It has the SDK with JCreator and everything. However, I want to be able to run the program on my Laptop which doesnt have the SDK. It has Java installed yes, but no SDK. How would I run the program? I got the source code but its no use. I have the compilied .class files from my main computer but I have no clue how to run them on the laptop. Do I have ot install the SDK and compile the source code or is there a way to just run the program directly?
    Thanks!

    Basically you just make certain that the manifest file has a "Main-Class" attribute, which is the name of a class that has the main() method that you want to invoke when the use double-clicks the jar. It's remarkably simple.
    I've never used JCreator, but if it's an IDE for Java it probably has a way to create these automatically. In Eclipse, you use the "Export" menu item on the "File" menu; it may be something similar in JCreator.
    Otherwise, you can use the "jar" utility that's part of the SDK. Read the docs on that. The docs also have links to the jar format and manifest files.

  • To run a program in batch every month on a particular working day

    Hi All,
    I have a requirement to run a program  in batch every month on the 17th working day.
    How can I achieve this?
    Thanks in advance.
    Ankit

    Hi,
    1.Create an event in tcode- SM62.
    2. write a ABAP program include this function module- RSPC_API_CHAIN_SCHEDULE(This function module is periodic)-> give the periods
    or
    go to RSPC-->start variant and give time as you want and schedule it according to your time.
    Then go to SM37 and select your job and go to job menu -->repeat scheduling
    giving time as you want and schedule it as daily
    Regards,
    Marasa.

  • How to run a program in background and how to check the output

    I have to run my program as background job... it has a selection screen...... and i need to check the output after its complete.

    hi,
    u need to create one program for this.
    tables:btcevtjob.
    parameters:job(32).
    data:count like btcevtjob-jobcount.
    call the function modules JOB_OPEN,JOB_SUBMIT AND JOB_CLOSE
    and pass the parameters in those function modules.
    once u execute this program,
    go with sm37->provide jobname->select the option scheduled
    ->execute
    selct the entry->go with release option.
    under releasae select immediate option
    save
    select the job name again
    go with release
    status is in finished stage
    now go with spool option
    give spool no
    go for display
    o/p displayed.
    before this,go for se38->provide the name of program which u want to run in back ground->seelct variants->change->provide variant name->go for create->provide input value->go with attributes->provide description->save
    this variant name u have to give in the job_submit fm.
    or
    se38->program->execute->in back ground
    Reward points if useful,
    Thanks,
    Usha

Maybe you are looking for