Running cmd programatically

Hi All,
I have set of files file1,file2,file3,file4...I have a batch file that needs 'file.xml' as a file containg input.
Now i want to rename above file1...file4.xml to file.xml and input it to batch file.
I want that i shd rename file1.xml to file.xml and after successful running of batch file move that file to a folder say FolderA.In FolderA it shd again be renamed to file1.xml.After this same procedure needs to be followed for file2,3,4
Can anyone guide me on this?

You can definitly write your own wizards, this is what the Extension Framework is all about.
Check out http://otn.oracle.com/products/jdev/htdocs/partners/addins/index.html for all the details.

Similar Messages

  • Please I can not get a .jar file to run on XP SP3 start/run/cmd/

    I can not get a .jar file to run on XP SP3 start/run/cmd/
    Please help if can figure this out. I'm convinced it is a Windows XP SP3 problem from searching on google and seeing other ppl on XP SP3 with same problem (but no working solution for myself). I'll try to be complete-listing all I've done.
    I had installed: Java SE Runtime Environment v6u14 for Windows Multi-language
    I had checked here it was working properly: http://www.java.com/en/download/manual.jsp
    I'm trying to run this jar file (soht-client-0.6.2.jar):
    http://prdownloads.sourceforge.net/telnetoverhttp/soht-java-client-0.6.2.zip?download
    http://www.ericdaugherty.com/dev/soht/javaclient.html < this is the information for the program.
    (yes the file can be executed and should open the program's window
    I wanted to post screenshot of it but friend that it's working for isn't here)
    _(Please find log of all cmds I did in this post here: http://pastebin.com/f792983df )_
    _I have extracted +'all' the files to: C:\062\+_ (I have tried using other directories, same problem)
    ++I then start/open/run/cmd+
    then I: cd C:\062\+
    then I try various commands - all+ of these do absolutely nothing- meaning no errors, no reply, no window opens, nothing except enters that directoy again:
    java -jar soht-client-0.6.2.jar
    java -jar -client soht-client-0.6.2.jar
    java -client -jar soht-client-0.6.2.jar
    java -jar soht-client-0.6.2.jar soht.properties
    soht-client-0.6.2.jar
    So I try this cmd: java soht-client-0.6.2.jar
    Reply:
    C:\062>java soht-client-0.6.2.jar
    Exception in thread "main" java.lang.NoClassDefFoundError: soht-client-0/6/2/jar
    Caused by: java.lang.ClassNotFoundException: soht-client-0.6.2.jar
    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)
    Could not find the main class: soht-client-0.6.2.jar. Program will exit.
    I try this cmd:
    java -jar soht-client-0.6.2.jar -client
    Reply:
    C:\062>java -jar soht-client-0.6.2.jar -client
    Unable to load configuration file: -client - java.io.FileNotFoundException: -cli
    ent (The system cannot find the file specified)
    SOHT Java Client
    The SOHT Java Client requires a properties file. Either start
    the application in the same directory as the soht.properties
    file, or specify the file name on the command line:
    java -jar soht-cleint-<version>.jar c:\soht.properties
    So then I do these cmds which produce the exact same error/reply just above; Unable to load..:
    j_ava -jar soht-client-0.6.2.jar -client soht.properties_
    java -jar soht-client-0.6.2.jar -client C:\062\soht.properties
    So then I copy soht.properties to C root and do:
    java -jar soht-client-0.6.2.jar -client C:\soht.properties <same error as above
    Then from other information I have read I right click on the .jar file, select open with Always open with:
    _"C:\Program Files\Java\jre6\bin\javaw.exe"_
    Try again.. same problem.
    Then I do cmd:
    _"C:\Program Files\Java\jre6\bin\javaw.exe" -jar "C:\062\soht-client-0.6.2.jar"_
    does nothing, retry the other commands same thing (either nothing or those same replies)
    Then I read (http://forums.sun.com/thread.jspa?threadID=5384879) someone had the same problem as I and they solved it by uninstalling all Java/reboot/ then install JDK 6 Update 14 with NetBeans 6.5.1 start NetBeans and then it worked for them.
    So I unistalled all Java, rebooted and gave the cmd another try (before re-installing), now a new error, of course:
    C:\062>java -jar soht-client-0.6.2.jar
    'java' is not recognized as an internal or external command, operable program or batch file.
    Then I install  Java SE and NetBeans Cobundle (JDK 6u14 and NB 6.5.1) Final Release/ reboot/ open Netbeans/
    go to test java page; all is good, run cmds again -and still nothing..
    C:\062>java -version
    java version "1.6.0_14"
    Java(TM) SE Runtime Environment (build 1.6.0_14-b08)
    Java HotSpot(TM) Client VM (build 14.0-b16, mixed mode, sharing)
    I reassociate program with: C:\Program Files\Java\jre1.6.007\bin\javaw.exe_
    same thing.. nothing
    Thank you very much for your time :D_
    PS. My computer has been newly reformatted so needing another reformat I'm sure is not the solution.

    Thank you very much for your replies Taggert_77 & swmtgoet_x :D
    Taggert77_: I have never used NetBeans. I only installed it in the bundle as I had read on another post that somehow installing the bundle magically helped another user with the same problem (he didn't know why it worked after that either).
    Before XP SP3 I was able to execute .jar file through cmd prompt. Now I am not.
    This file is executable, grab it and you will see. Here is a screen shot (program in front is FlashFXP, behind is the cmd prompt and what should happen):http://www.freeimagehosting.net/uploads/53273b4ddf.jpg
    swmtgoetx_: I only did the other cmd's to try to make it spit out something, anything lol :D
    The proper cmd is simply: java -jar soht-client-0.6.2.jar
    I did give your cmd a try, and it produced nothing :( (just like the other correct cmds)
    java -client -jar soht-client-0.6.2.jar soht.properties
    Thank you again...the mystery remains
    PS. If you do a search for this you'll find an amazing amount of XP SP3 users with the same problem and no solution posted that I could find except one chap that did the unistall install order that I did above).

  • Requirement is to run CMD.EXE under the Local System Account. So that we can map a network drive to be used by a windows service, which will be created by command: - net use z: \\servername\sharedfolder /persistent:yes

    Environment:
    OS:  Windows 7 32/64 bit, Windows 2008 Server 64
    bit/ Windows 2012 Server 64 bit
    Priority:
    - Critical
    Requirement: - Since
    the Windows Service is running under the Local System Account, we would like to emulate this same behaviour.
    Basically, we would like to run CMD.EXE under the Local System Account. So that we can map a network drive to be used by a service using following
    command
    net use z: \\servername\sharedfolder /persistent:yes.
    Already Attempt:
    We tried to launch the CMD.exe using the DOS Task Scheduler AT command.  Here’s a sample command:
    AT 10:36 /interactive cmd.exe
    But I received a warning that “due
    to security enhancements, this task will run at the time excepted but not interactively.”
    It turns out that this approach will work for XP, 2000 and Server 2003 but due to session isolation
    Interactive services no longer work on Windows 7, Windows Server 2008 and above.
      2.  We
    tried to create a secondary Windows Service via the Service Control (sc.exe) which merely launches CMD.exe.
    <Drive>:\sc create RunCMDAsLSA binpath= "cmd" type=own type=interact <Drive>:\sc
    start RunCMDAsLSA
    In this case the service fails to start and results it the following error message:
    FAILED 1053: The service did not respond to the start or control request in a timely fashion.
      3. One
    suggestion, we found to launch CMD.exe via a Scheduled Task, but
    it is not giving any option to launch CMD.exe in interactive mode; so that I can map network drive using net command.
      4. I read an article, which
    demonstrates the use of PSTools from SysInternals. I launched the command line and executed following command
    psexec -i -s cmd.exe
    PSTools worked fine, but It seems that in scope of Sysinternals Software License
    Terms. You may not "use the software for commercial software hosting services."
    Application will deploy on client, which will be like commercial,
    so we are not able to use PSTools.         
    Kindly assist us for achieving the requirement. We have tried all the ways, but nothing is working for us. Kindly suggest.
    I will be really thankful.

    Hi Sir,
    Nothing worked from above for us. You can see our remarks on posted query.
    That’s why, we posted on forum.
    And there will not be any vulnerability, because, if we will use "net
    use ..."
    in network domain; definitely,
    we will provide username and password of mapped drive system.
    And, that system, itself is given by client; so that, there must not be any vulnerability; they are ready to provide user name and password.
    We need a way; by which we can complete the requirement. Kindly assist.
    Regards,
    S. P. Singh

  • Solaris 10 06/06 x86 install Unable to run cmd: /usr/sbin/sysidput

    Hello,
    When I install Solaris 10 06/06 on my x86 machine, I follow all of the prompts. Eventually , I get to a place in the X Windows GUI where I enter my IP, netmask, Router IP, DNS server IPs, domain, and search list.
    I get an error at the end of th network configuration section.
    runCmd error in /usr/sbin/sysidput with output:
    Unable to run cmd: /usr/sbin/sysidput
    No sysidcfg found.
    I found my sysidcfg at /etc/sysidcfg. everytime I try to create a file or copy a file over to /usr/sbin. I get a read only error. I am logged in as root..
    /etc is not my $PATH. Is that the problem? Do special commands exist to put it in the path?
    Please help. I have not used UNIX in two years. I not know Solaris Administration.
    Does a newer DVD exist with the fix already done?
    Thank you very much.
    Andre Mikulec
    [email protected]

    This is a known issue. Do not configure the network at the time of OS installation. Select NON-Networked and continue,
    Once you are done with the installation, run sys-unconfig and you will be able to configure the network.
    -M

  • Unable to run cmd:/usr/sbin/sysidput

    Trying to load Solaris10 from a jumpstart server running Solaris 8. I keep getting the error Unable to run cmd: /usr/sbin/sysidput. It seems to have something to do with networking. Does anybody know what this error is or a workaround for it.

    Well, i saw it in a Solaris 10 Beta, it should be fixed in the current version.
    Do you have a sysidcfg file? If so, what does it point out as a primary interface? Maybe the primary interfaces specified in that file doesn't exists on the machine.
    Othervise, check the /var/sadm/system/logs/sysidtool.log file (might be under /a/var/sadm/system/logs/sysidtool.log )
    //Magnus

  • Solaris10 install - unable to run cmd /usr/sbin/sysidput

    I have an Ultra10 at home with Solaris9 on it now. Attempting to install Solaris10 from CDs. Boots up fine on first CD, then tries to configure hme0 and chokes. Gives me errors "Warning: hme0: fault detected in device; service degraded" and "Warning: hme0: No response from Ethernet network: link down --cable problem?"
    I'm using a Linksys cable modem BEFCMU10 and Linksys cable router WRT54GS. Noticed it started doing this when I changed from old BEFSR41 router to new wireless router.
    Well, I ignore this error and move on. Install process gathers info such as dhcp (yes, my router set up to do this), time zone and so forth. It processes my inputs and then gives me the error "unable to run cmd /usr/sbin/sysidput".
    Anyone have either of these problems and resolve them successfully?
    Thanks, Ron

    How do I enable this at install time from the CDs?Afraid the answer is likely burn a custom boot CD
    after judicious tampering with the GA media-set - or -
    read up on custom JumpStart installations (neither
    are exactly for the faint hearted, both are probably
    overkill).
    Wondering if this is causing the other error "unable
    to run cmd /usr/sbin/sysidput"?Could be a combination of a bug in the installer
    triggered by primary netif down + DHCP network
    parameter configuration selected.
    Suggestion would be (as next poster suggests)
    rebuild with node detached from LAN, and, with
    static, dummy network parameters as workaround,
    then post-install setup etc/system to work around
    your switch's carrier-sense bogosity as per Sol9
    as well as re-enable for DHCP.
    It's probably also worth filing this as a bug if you
    have a SunService contract; it wouldn't be the
    first time one of OpenPROM, the install-time
    mini-root, suninstall, or dhcpagent have shipped
    with inbuilt "just don't do's".
    IOTW - work around the problem, bug it with Sun
    if it's reproducable, then get on with life.

  • Jumpstart - Unable to run cmd: /usr/sbin/sysidput

    I'm working on migrating my main NIS/Jumpstart server from Solaris 8 to Solaris 10. I've setup up a new Solaris 10 NIS/Jumpstart server for testing purposes while the Solaris 8 server is still in production.
    Any time I try to install a client with this new Solaris 10 server, it blows up when it gets to the "Please wait while the system is configured with your settings..." window.
    An Error dialog is displayed with the text "An error has occurred in configuring the system. Please go back and check your settings."
    The console shows:
    Completing system identification...
    runCmd error in /usr/sbin/sysidput
    Unable to run cmd: /usr/sbin/sysidput
    General error, see /var/sadm/system/logs/sysidtool.logThe sysidtool.log doesn't show anything of any interest, so that's a dead-end.
    Of course I've tried changing all the settings, getting rid of sysidcfg all together and answering the prompts instead, but the install still fails in the same way.
    Any help will be greatly appreciated.
    Thanks,
    --Zach
    Edited by: ZachAnthony on Oct 9, 2007 2:41 PM
    Edited by: ZachAnthony on Oct 9, 2007 2:42 PM

    I too faced this error and wondered wat 2 do. Its just elementary
    Press Stop A combination and come to OK prompt if sparc machine
    Remove LAN cable and restart by executing command : boot cdrom
    Go for NON NETWORKED option while installation.Later you can setup after installation
    If u want u can enable remote services
    It will work...no need to do anything with sysidput file
    I have advised this option for sparc machines
    if any issues reply.................

  • Can't run CMD

    Hi I am trying to run cmd on my computer so I can find out what my ip address and my mac address are but when I click on run and type cmd I get a message telling me that there is no such connection.
    any advise will be greatly apreciated.

    What is the operating system you are using,....?
    CMD  only works for win 2000 & WIN XP
    If you are using win 98 or Win ME ,.......... Try commwnd at the run box

  • PowerShell run cmd command

    Hello,
    I am very new to PowerShell scripting.
    Suddenly we want to move our code from VB script to PS, and i don't have much idea how to wrote this statement in PS.
    wshShell.Run(myCommand,0,false)
    Requirement: myCommand is IBM bat command (ibmdisrv) and its arguments, and want to run in background (So if I close PS screen or log off the server, still command run as a process).
    Thanks in advance.

    Thanks For you response, 
    Still not getting many things, I have tried Start-Job but not working with me, By hook and crook my command working but it is not going to background or silent, always popup cmd promt.
    Here it is VB script
    Set wshShell = WScript.CreateObject("WSCript.shell")
    var strCommand = "cmd.exe /K """"" & IDI_HOME & "\ibmdisrv"" -c""" & IDI_CONFIG_DIR & "\" & IDI_CONFIG_FILE & """ -r""" & IDI_ASSEMBLYLINES
    ' -c for config file and -r for assemlyLine flow
    cmdResponse = wshShell.Run(strCommand,0,false)
    Now want to PS (I tried but not worked)
    $commandLine = '& "$TDI_INSTALL_HOME\ibmdisrv" -c "$TDI_CONFIG_FILE" -r "$TDI_ASSEMBLYLINE"';
    Start-Job -ScriptBlock {Invoke-Expression -Command:$commandLine}}
    Thanks

  • Running CMD command in PS

    In PS2, I always use cmd.exe /C to run DOS commands.
    However, I ran into this scenario:
    The first try, using cmd.exe /C, failed with the above error.
    The second try, running the command directly, was successful.
    Anyone can explain why?
    Thanks.

    PowerShell will strip the quotation marks from your string when it gets passed to cmd.exe, and you have some special characters in that password which will cause problems if it's not quoted.  In this case, it's the > character 4 characters into the
    password that's ending the command.  It tries to set a 4-character password, and sends stdout to a goofy file name starting with 3A.
    There's also a problem with the backticks in the password, which will also be removed by PowerShell when it parses a double-quoted string.  Even in your second command, you'll find that the password doesn't work if you try to type it with the backticks
    included.
    As a simple workaround, wrap the password in a set of single quotes (leaving the double quotes included) if you want to pass it to cmd.exe for some reason.  This will also prevent PowerShell from using the backtick as an escape character:
    cmd.exe /C net user Administrator '"B?E;>3A`w+8D6z^G2T`Y3K1"'
    If you want to just run net user from PowerShell, I'd probably put the password into a single-quoted here-string to avoid any problems with escaping characters:
    $password = @'
    B?E;>3A`w+8D6z^G2T`Y3K1
    net user Administrator $password

  • Running CMD command from process.exec

    I've been chopping this code up so forgive me if this is a mess, however I cannot figure out why this command simply will not work. It never seems to attempt to sign the jar files. I've also tried to sign the jar file by using an output stream. I can run the System.out of the payload from the CMD and it works fine.
    When this method is executed it seems to loop over like nothing is happening.
    private void signJar(String jarPath)
                   String payload = "\"c:\\program files\\java\\jdk1.6.0_17\\bin\\jarsigner.exe\" -keystore \"" + ksPath + "\" -storepass " + ksPW + " \"" + jarPath + "\" " + ksAlias;
                   try {
                        Process proc = Runtime.getRuntime ().exec("cmd /c " + payload);
                        InputStream inputstream = proc.getInputStream();
                        InputStream errorstream = proc.getErrorStream();
                        InputStreamReader inputstreamreader = new InputStreamReader(inputstream);
                        InputStreamReader errorstreamreader = new InputStreamReader(errorstream);
                        BufferedReader inputreader = new BufferedReader(inputstreamreader);
                        BufferedReader errorreader = new BufferedReader(errorstreamreader);
                        while ((line = inputreader.readLine()) != null) {
                             d.asyncExec(new Runnable() {
                                  public void run(){
                        l.setText(line + "\n" + l.getText());
                        while ((line = errorreader.readLine()) != null) {
                             d.asyncExec(new Runnable() {
                                  public void run(){
                             l.setText(line + "\n" + l.getText());
                        errorreader.close();
                        inputreader.close();
                        return;
                        catch(IOException e)
                             e.printStackTrace();
                             return;
              }

    sabre150 wrote:
    You probably have a deadlock since your code falls for at least 2 of the traps described in the 4 sections of [http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html|http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html].
    Thanks, I checked this out and decided to implement one of the methods he had, however, now I am getting an illegal argument exception. I think it is because of my payload, but I am not sure how to fix it. I know everything is formatted properly to input it in the console manually.
    private void signJar(String jarPath)
                   String payload = "\"c:\\program files\\java\\jdk1.6.0_17\\bin\\jarsigner.exe\" -keystore \"" + ksPath + "\" -storepass " + ksPW + " \"" + jarPath + "\" " + ksAlias;
                   String cmds[] = {"cmd","/c",payload};
                   if (cmds.length < 1)
                     System.out.println("USAGE: java GoodWindowsExec <cmd>");
                     System.exit(1);
                 try
                     String[] cmd = new String[3];
                         cmd[0] = "cmd.exe" ;
                         cmd[1] = "/C" ;
                         cmd[2] = cmds[2];
                     Runtime rt = Runtime.getRuntime();
                     System.out.println("Execing " + cmd[0] + " " + cmd[1]
                                        + " " + cmd[2]);
                     Process proc = rt.exec(cmd);
                     // any error message?
                     StreamGobbler errorGobbler = new
                         StreamGobbler(proc.getErrorStream(), "ERROR");           
                     // any output?
                     StreamGobbler outputGobbler = new
                         StreamGobbler(proc.getInputStream(), "OUTPUT");
                     // kick them off
                     errorGobbler.start();
                     outputGobbler.start();
                     // any error???
                     int exitVal = proc.waitFor();
                     System.out.println("ExitValue: " + exitVal);       
                 } catch (Throwable t)
                     t.printStackTrace();
              }Updated with different code still same error
    EDIT: I should pay closer attention and stop trying to copy and paste code. I see where he says you can't use it like the command line...

  • Running cmd commands through java

    Hi,
    I am trying to run few dos commands through java using Runtime.exec("command") but I am getting following error
    commmand is cd D:\CodeMerge\A\
    java.io.IOException: CreateProcess: cd.. error=2
    at java.lang.Win32Process.create(Native Method)
    at java.lang.Win32Process.<init>(Unknown Source)
    at java.lang.Runtime.execInternal(Native Method)
    at java.lang.Runtime.exec(Unknown Source)
    at java.lang.Runtime.exec(Unknown Source)
    at java.lang.Runtime.exec(Unknown Source)
    at java.lang.Runtime.exec(Unknown Source)
    at createDirectory.main(createDirectory.java:24)
    Basically what I am looking for is this:
    1) My program is in D:\Amit\RM
    2) I want to get out to D:\ go to CodeMerge\A\.
    3) Create folder with curretn date as name of the folder
    Hence I am doing
    rTime.exec("cd../..");
    rTime.exec("cd D:\CodeMerge\A\");
    rTime.exec("mkdir "+date);
    Can anybody tell me why I am getting this error
    Jounty

    U can run either DOS Commands or UNIX Commands thru the following Java Program
    Written By BalaNagaraju Malisetti
    contact: [email protected]
    import java.io.*;
    public class RunBdiff
    public static String rununixcmd(String v_prev_path,String v_curr_path,String v_delta_path,String v_beg,String v_len)
    String s = null;
    FileOutputStream fos;
    DataOutputStream dos;
    try
    int v_int_beg = Integer.parseInt(v_beg);
    int v_int_len=Integer.parseInt(v_len);
    int v_int_end=(v_int_beg+v_int_len)-1;
    String v_pos1=String.valueOf((v_int_beg+2));
    String v_pos2=String.valueOf((v_int_end+2));
    String cmd1 = "bdiff ";
    String cmd2=v_prev_path;
    String cmd3=" ";
    String cmd4=v_curr_path;
    String cmd5="| grep '^>'";
    String cmd6="| cut -c";
    String cmd7=v_pos1+"-"+v_pos2;
    String cmd8="| sort ";
    String cmd9="| uniq ";
    String cmd=cmd1+cmd2+cmd3+cmd4+cmd5+cmd6+cmd7+cmd8+cmd9;
    String[] commands = {"/bin/csh","-c",cmd}; //in Unix
    //String[] commands = {"cmd.exe","-c",cmd}; //in Windows
    Process p = Runtime.getRuntime().exec(commands);
    BufferedReader stdInput = new BufferedReader(new InputStreamReader(p.getInputStream()));
    BufferedReader stdError = new BufferedReader(new InputStreamReader(p.getErrorStream()));
    // read the output from the command
    File file = new File(v_delta_path);
    fos = new FileOutputStream(file);
    dos=new DataOutputStream(fos);
    //Writing the output of bdiff command to Delta File
    while ((s = stdInput.readLine()) != null)
    dos.writeChars(s);
    //Return Error Message to Calling Procedure
    while ((s = stdError.readLine()) != null)
    return s;
    return s;
    catch (IOException e)
    return String.valueOf(e);
    public static void main(String args[])
    String msg=rununixcmd("/home/g_anil/MS_ADDRESS1.dat","/home/g_anil/MS_ADDRESS2.dat","/home/g_anil/MS_ADDRESS_DELTA.dat","1","9");
    **************************************************************************************************************************************

  • How to run .cmd file from a Powershell script

    Hi,
    I would like to know how I run commands from a powershell script? how to use the invoke-command?
    This powershell script doesnt work for me
    Invoke-Command C:\setup.cmd -ArgumentList install-setupforced

    To run a batch file from powershell, just type its name with arguments. I'd recommend explicitly including the .CMD file type and, if it is located in the current folder, powershell rules require you to explicitly say so, i.e.:
       ./mybatch.cmd inputfile.txt outputfile.txt
    To run a single cmd.exe command, just prefix it with cmd.exe /c as Mike says:
        cmd.exe /c color 48
    to run a series of "&"- separated cmd.exe commands you need to enclose the complete command string in double quotes:
        cmd.exe /c "color 37 & dir"
    Beyond that it can get complicated due to various characters that are special to powershell and those special to cmd.exe. If you need to run a series of cmd.exe commands, your best short term bet is to put them in a batch file. The best long-term bet is
    to move more completely to the powershell way of doing things...
    Al Dunbar -- remember to 'mark or propose as answer' or 'vote as helpful' as appropriate.

  • Unable to run cmd.exe in hosted web application?

    Hi
    I have to execute a cmd.exe in web application to merge a file.My code work fine on my dev environment. But on hosting the
    application on server unable to run the cmd.exe . Below is the code.
     ProcessStartInfo processStartInfo = new ProcessStartInfo("cmd.exe");
                        processStartInfo.RedirectStandardInput = true;
                        processStartInfo.RedirectStandardOutput = true;
                        processStartInfo.UseShellExecute = false;
                        Process process = Process.Start(processStartInfo);
                        if (process != null)
                            process.StandardInput.WriteLine("c:");
                            process.StandardInput.WriteLine("xcopy " + srcfilename + " " + destfilename + "
    /a /m /d /s /e /v");
                            // process.StandardInput.WriteLine("a");
                            process.StandardInput.Close(); // line added to stop process from hanging on ReadToEnd()
                            string outputString = process.StandardOutput.ReadToEnd();
                            process.Close();
                            // process.Kill();                   
    Pawan

    What is the hosting you are using on azure? Hosted your application as Azure web site or cloud service?
    If it is a azure cloud service - you will either need to define the start up tasks to do the same or need to run your azure roles in elevated context.
    Read more - https://msdn.microsoft.com/en-us/library/azure/gg456327.aspx
    https://msdn.microsoft.com/en-us/library/gg557553.aspx#Runtime
    Bhushan | Blog |
    LinkedIn | Twitter

  • Allow a windows non-administrator user to run cmd.exe as administrator without sharing administrator password with the user

    I have standalone Windows 2003 and 2008 Oracle database servers (they are not in a Windows domain environment ). The Oracle DBAs can perform all their routine activities from command line with administrator privileges. For this i've to either share administrator
    user password with the Oracle DBAs or add their windows login user to Administrators group. If i can give the DBA user permission to run windows command prompt without sharing administrator password, i can give them non-administrator login access to Windows
    2003/2008 server. Normally when a non administrator user would try to run a program as administrator on Windows 2008, the user is prompted to input administrator username/password. Is it possible to give non-admin user access to run a program/application (cmd.exe
    in this case) on Windows 2003/2008 without sharing administrator credentials with them?

    With the OTORISER application I developed, normal users can run applications with admin privilege …  
    Otoriser is totally free ! Applications, mmc consoles, control panel cpl files can be run under admin and system context with Otoriser. Let’s say you donot want your users to be admin in their machines, but want them to run some applications with admin rights.
    If this is the case then you are on the right blog.
    There are two components for Otoriser. Management and client components. There are no complex implementation and no frustrating steps to be performed. Within 10 minutes you can start testing the results
    After you download the setup files, install client components in the client by running it directly (or any deployment method you have), it will take about 5 seconds to install it. Then, let’s say you want your user to change system properties of the machine.
    With the tool provided in Admin package produce the hash of system.cpl file and enter that hash into the group policy (details are provided in documentation). When policies are applied for that user then he or she can run that control panel applet under admin
    context but donot forget that the user is still an ordinary user.
    download link :
    http://burakuysaler.wordpress.com/2013/02/21/with-the-otoriser-application-that-i-developed-normal-users-can-run-applications-with-admin-priviledges

Maybe you are looking for

  • Files showing up on iTunes, but not in iPod

    So a few days back, my iPod acted up and restored itself, sort of. Well, my iPod synced itself and added the music files from my library. So now when I look at my iPod files through my iTunes, the files show up grey and i can't play them yet they're

  • App-1

    in automatic payment programme where u can define the ranking order? what is the ranking order ? why should we give the ranking order? plz clarrify this.

  • Debugging in Xcode App. not built in Xcode in Intel Machine doesn't work

    I am using Xcode version 2.4.1 in a MacBook Pro with MAC OS X 10.4.11. I build my app using ant. The output is an application bundle. I try debugging my app using Xcode, because of a nicer interface. To do this, I create an empty project, add a custo

  • Keyboard and mouse (connect to keyboard) no respone?

    sometime the keyboard and mouse doesn't respone after get back from sleep. does anyone encounter similar problem?

  • LSMW Read Data shortdump

    Hi guys.. I'm currently testing out on LSMW I'm trying to create new material for transaction MM01. But when i click on Step 9: Read Data i get a shortdump What happened?     The current ABAP program had to be terminated becaus     ABAP processor det