Running os command

Hi,
I am wanting to run a system command (rsync actually) from withing a jsp page. Does anyone know how I would be able to do this?
Thanks,
Harlin

Hi, Shai!
The error 2 comes from the CreateProcess() call from Windows GetLastError(): 2 - "The system cannot find the file specified. - ERROR_FILE_NOT_FOUND". Check the filepath!
Regards,
Thomas

Similar Messages

  • Urgent!! running system command in java

    i am trying to run system command(windows) in java. I am getting
    exception as java.io.IOException: CreateProcess: c:\dir
    Please Help.
    Here is the code
    import java.io.*;
    public class RunCommand {
    public static void main(String[] args) {
    try
    //run dir command
    Process p = Runtime.getRuntime().exec("c:\\dir");
    BufferedReader stdInput=new BufferedReader(new
    InputStreamReader(p.getInputStream()));
    BufferedReader stdError =new BufferedReader(new
    InputStreamReader(p.getErrorStream()));
    //read the output
    System.out.println("here is the output:\n");
    while((s=stdInput.readLine())!=null){
    System.out.println(s);
    System.out.println("here is the error if any");
    while((s=stdError.readLine())!=null){
    System.out.println(s);
    System.exit(0);
    }//end try
    catch (IOException e)
    System.out.println("exception Happened" );
    e.printStackTrace();
    System.exit(-1);

    It works fine if you replaceProcess p = Runtime.getRuntime().exec("c:\\dir");withProcess p = Runtime.getRuntime().exec("cmd /c dir");And don't forget to define your s variable.

  • Run shell commands using java program

    Hi guys,
    I am trying to run shell commands like cd /something and ./command with arguments as follows, but getting an exception that ./command not found.Instead of changing directory using "cd" command I am passing directory as an argument in rt,exec().
    String []cmd={"./command","arg1", "arg2", "arg3"};
    File file= new File("/path");
    try{
    Runtime rt = Runtime.getRuntime();
    Process proc = rt.exec(cmd,null,file);
    proc.waitFor();
    System.out.println(proc.exitValue())
    BufferedReader buf = new BufferedReader(new InputStreamReader(proc.getInputStream()));
    catch(Exception e)
    {e.printStackTrace();
    So can anyone please tell me what is wrong with this approach? or is there any better way to do this?
    Thanks,
    Hardik

    warnerja wrote:
    What gives you the idea that the process to execute is called "./command"? If this is in Windows, it is "cmd.exe" for example.It does not have to be cmd.exe in Windows. Any executable or .bat file can be executed as long as one either specifies the full path or the executable is in a directory that is in the PATH.
    On *nix the file has to have the executable bit set and one either specifies the full path or the executable must be in a directory that is in the PATH . If the executable is a script then if there is a hash-bang (#!) at the start of the first line then the rest of the line is taken as the interpreter  to use. For example #!/bin/bash or #!/usr/bin/perl .
    One both window and *nix one can exec() an interpreter directly and then pass the commands into the process stdin. The advantage of doing this is that one can change the environment in one line and it  remains in effect for subsequent line. A simple example of this for bash on Linux is
    import java.io.OutputStreamWriter;
    import java.io.Writer;
    public class ExecInputThroughStdin
        public static void main(String args[]) throws Exception
            final Process process = Runtime.getRuntime().exec("bash");
            new Thread(new PipeInputStreamToOutputStreamRunnable(process.getErrorStream(), System.err)).start();
            new Thread(new PipeInputStreamToOutputStreamRunnable(process.getInputStream(), System.out)).start();
            final Writer stdin = new OutputStreamWriter(process.getOutputStream());
            stdin.write("xemacs&\n");
            stdin.write("cd ~/work\n");
            stdin.write("dir\n");
            stdin.write("ls\n");
            stdin.write("gobbldygook\n"); // Forces output to stderr
            stdin.write("echo $PATH\n");
            stdin.write("pwd\n");
            stdin.write("df -k\n");
            stdin.write("ifconfig\n");
            stdin.write("echo $CWD\n");
            stdin.write("dir\n");
            stdin.write("cd ~/work/jlib\n");
            stdin.write("dir\n");
            stdin.write("cat /etc/bash.bashrc\n");
            stdin.close();
            final int exitVal = process.waitFor();
            System.out.println("Exit value: " + exitVal);
    }One can use the same approach with Windows using cmd.exe but then one must be aware of the syntactic differences between commands running in .bat file and command run from the command line. Reading 'help cmd' s essential here.
    The class PipeInputStreamToOutputStreamRunnable in the above example just copies an InputStream to an OutputStream and I use
    import java.io.IOException;
    import java.io.InputStream;
    import java.io.OutputStream;
    public class PipeInputStreamToOutputStreamRunnable implements Runnable
        public PipeInputStreamToOutputStreamRunnable(InputStream is, OutputStream os)
            is_ = is;
            os_ = os;
        public void run()
            try
                final byte[] buffer = new byte[1024];
                for (int count = 0; (count = is_.read(buffer)) >= 0;)
                    os_.write(buffer, 0, count);
            } catch (IOException e)
                e.printStackTrace();
        private final InputStream is_;
        private final OutputStream os_;
    }

  • Running Shell Commands (not Executable) in Unix from Java

    What are my options to run shell commands from Java?
    My goal is to change my existing shell environment variables to some new ones provided by .anotherProfile.
    Using an executable from Java is not an option because it does not work i.e. ( exec(". /home/.profile") ) brings up errors.
    Someone has suggested that I start a child shell with that profile and work from there, but I'm unfamiliar with that sort of syntax and programming in general.
    Any good help equals duke dollars :)

    Well there are some possibilities. In the original thread you mentioned that you wanted the shell script to be executed to change some enviroment parameters of the shell the JVM is executing in.
    If so, and you are able to rewrite the profile so you can parse it manually. Then you can change some environment setting by writing the JNI wrappers for the getenv and setenv system calls. (Check your man pages)
    That will change the environment. I am just wondering what good it will do for you? What's use of sourcing the profile in a JVM?

  • Applescript for running sudo commands in terminal

    I'm a newbie when it comes to Applescript and was wondering if someone could help with a basic request. I need to write a small script to do the following:
    1. Launch terminal
    2. Run the 'Sudo -s' command
    3. Enter the administrator password (in plain text)
    and then
    4. run some sudo commands like "sudo defaults write /Library/Preferences/com.apple.loginwindow HiddenUsersList -array-add administrator"
    I actually WANT the administrator password to be in the script in plain text even though I understand the security risks (I will literally be the only person to ever see the script). I've trawled forums all over but can't seem to find what I am looking for and cannot get it working by patching together the various commands I have found. Thanks in advance for any help you can give!
    Sean

    I've included two examples.  The preferred way & the hacker way.
    with administrator
    It is easier to diagnose problems with debug information. I suggest adding log statements to your script to see what is going on.  Here is an example.
        Author: rccharles
        For testing, run in the Script Editor.
          1) Click on the Event Log tab to see the output from the log statement
          2) Click on Run
        For running shell commands see:
        http://developer.apple.com/mac/library/technotes/tn2002/tn2065.html
    on run
        -- Write a message into the event log.
        log "  --- Starting on " & ((current date) as string) & " --- "
        --  debug lines
        set unixDesktopPath to POSIX path of "/System/Library/User Template/"
        log "unixDesktopPath = " & unixDesktopPath
        set quotedUnixDesktopPath to quoted form of unixDesktopPath
        log "quoted form is " & quotedUnixDesktopPath
        try
            set fromUnix to do shell script "sudo ls -l  " & quotedUnixDesktopPath with administrator privileges
            display dialog "ls -l of " & quotedUnixDesktopPath & return & fromUnix
        on error errMsg
            log "ls -l error..." & errMsg
        end try
    end run
    This version has an inline password.
    Notice the echo 'password' |
    The single quotes are no accident.
    It is easier to diagnose problems with debug information. I suggest adding log statements to your script to see what is going on.  Here is an example.
        Author: rccharles
        For testing, run in the Script Editor.
          1) Click on the Event Log tab to see the output from the log statement
          2) Click on Run
        For running shell commands see:
        http://developer.apple.com/mac/library/technotes/tn2002/tn2065.html
    on run
        -- Write a message into the event log.
        log "  --- Starting on " & ((current date) as string) & " --- "
        --  debug lines
        set unixDesktopPath to POSIX path of "/System/Library/User Template/"
        log "unixDesktopPath = " & unixDesktopPath
        set quotedUnixDesktopPath to quoted form of unixDesktopPath
        log "quoted form is " & quotedUnixDesktopPath
        try
            set fromUnix to do shell script "echo 'password' | sudo ls -l  " & quotedUnixDesktopPath
            display dialog "ls -l of " & quotedUnixDesktopPath & return & fromUnix
        on error errMsg
            log "ls -l error..." & errMsg
        end try
    end run

  • "Run As" Command Not Working

    I'm trying to install a HP Printer & when install program checks for system requirements I'm getting this message...This system cannot be installed using the "Run As" command. Does anyone know why this would be and how to fix it?

    Satellite A215-S7444
    Sounds like you may be installing old stuff from a CD.
    Uninstall the printer and then see this page..
    Downloading a Printer Driver Package and Installing the Drivers in Windows Vista for a Printer Conne...
    Download the new Vista software from Select software and drivers.
    -Jerry

  • Running a command in a command line tool in fastest way

    Before anything I want to clarify some terms : 
    apk
    file (android application package file) : equivalent to executable (exe) files on windows
    aapt.exe
    : A command line tool which comes with android sdk in order to fetch information of an apk file (It obviously has other usages)
    note : This question is not about an android feature. It's all about C# and functionality of .Net framework 
    An
    apk file has a name just same as any other file, but it has a internal name (which will be shown when you install apk file on android os as name of application) 
    with
    aapt.exe I can get internal name of an apk using following command :  
    aapt
    d badging "<apk path>"
    I
    have copied aapt.exe where executable file of my c# application is and I want  :
    Enter
    above command for each apk in selected directory (using GetAllFiles method)
    I want to get internal names of apk files and
    I've tried a lot of ways and I've searched a lot. finally this is what I've got : 
    Process proc = new Process();
    proc.StartInfo.FileName = "cmd.exe";
    proc.StartInfo.RedirectStandardInput = true;
    proc.StartInfo.RedirectStandardOutput = true;
    proc.StartInfo.UseShellExecute = false;
    proc.StartInfo.StandardOutputEncoding = System.Text.Encoding.UTF8;
    proc.Start();
    using (StreamWriter sw = proc.StandardInput)
    foreach (string path in Directories.GetAllFiles(@"E:\apk", "apk"))
    sw.WriteLine("aapt d badging " + "\"" + path + "\"");
    //following line doesn't work because sStandardInput is open
    Debug.WriteLine(proc.StandardOutput.ReadToEnd());
    // There will be a really huge amount of text (at least 20 line per sw.Writeline) and
    //it impacts performance so following line is not really what I'm looking for
    Debug.WriteLine(proc.StandardOutput.ReadToEnd());
    GetAllFiles is
    a function that I've created to fetch all apk file full path. It gets two argument. First argument is path and second one is extension of file you want its full path to be fetched.
    This is not final code.
    As I've commented it out first Debug.WriteLine doesn't
    work and second one is not a good idea. how should I get output from proc?
    I have tried running process by argument and its awful :)
    As another approach :
    Because apk files are basically zip files I can extract them get what I want from them.
    There is an xml file named Androidmanifest.xml in every apk file.
    Androidmanifest.xml is like an ID card for an apk file and apk internal name can be found in it but here are some problems with this approach : 
    1. Androidmanifest.xml is not a plain text file. It's coded and it requires a lot of complexity to decode it
    2. application name (or apk internal name) is an attribute in this file and it's value is not a string value. It's a reference to a file where strings are stored and worst thing is it's not an easy to find out reference. It's just a number

    And you don't get any output from it? Maybe you're passing the arguments incorrectly?
    No. I don't get any result and I have checked arguments and it's correct.
    But you are already running a separate process for every apk file. You start a single cmd.exe and then send it commands that will cause aapt to be run for every file. Unless aapt accepts multiple apk filenames on the command line there's no way
    around using separate processes.
    I didn't know that. anyway speed in this way is much more rather than creating a function. creating a Process object in it and calling function for each apk file.
    I read somewhere that it's possible to run multiple commands in cmd by & operator but as you said I think every command runs aapt. I have tested this approach too and it's very very slow
    fastest approach I have found is what I have wrote here and speed is about  0.6 per apk file which is still slow when there is thousands of apk files.
    I tried an application that does same thing (fetching apk information) and in it's installation directory I found aapt.exe which means it uses this tool to get information but speed is significantly faster rather than my application.   
    So what's your suggestion about this? 

  • Process.Start - getting different output when running command using this method than I am if I run same command in CMD prompt

    Hi
    Creating an application to analyze .dmp files - all working well except this odd issue
    If I open command prompt and enter this command:-
    kd -z C:\Windows\MiniDump\042414-24632-01.dmp -c "!analyze -v"
    Then it works and shows me all the output I need (shown at bottom of post)
    If I run same command in VB.net using following code - then it doesn't give the same output - the bits I need at the end created by the !analyze -v switch don't appear
    Any ideas why it is not seeing the switch correctly - setting a breakpoint and checking contents of startinfo seems to be showing correct cmd line i.e. "kd -z C:\windows\minidump\042414-24632-01.dmp -c "!analyze –v;q""
    Dim myprocess As New Process()
    myprocess.StartInfo.FileName = "C:\Program Files (x86)\Windows Kits\8.1\Debuggers\x86\kd"
    myprocess.StartInfo.Arguments = "-z C:\windows\minidump\042414-24632-01.dmp -c ""!analyze –v;q"""
    myprocess.StartInfo.UseShellExecute = False
    myprocess.StartInfo.RedirectStandardOutput = True
    myprocess.StartInfo.CreateNoWindow = True
    myprocess.Start()
    TextBox1.AppendText(myprocess.StandardOutput.ReadToEnd())
    Output when run from cmd prompt:-
    C:\Program Files (x86)\Windows Kits\8.1\Debuggers\x86>kd -z C:\Windows\MiniDump\042414-24632-01.dmp -c "!analyze -v;q"
    Microsoft (R) Windows Debugger Version 6.3.9600.17298 X86
    Copyright (c) Microsoft Corporation. All rights reserved.
    Loading Dump File [C:\Windows\MiniDump\042414-24632-01.dmp]
    Mini Kernel Dump File: Only registers and stack trace are available
    Symbol search path is: *** Invalid ***
    * Symbol loading may be unreliable without a symbol search path. *
    * Use .symfix to have the debugger choose a symbol path. *
    * After setting your symbol path, use .reload to refresh symbol locations. *
    Executable search path is:
    * Symbols can not be loaded because symbol path is not initialized. *
    * The Symbol Path can be set by: *
    * using the _NT_SYMBOL_PATH environment variable. *
    * using the -y <symbol_path> argument when starting the debugger. *
    * using .sympath and .sympath+ *
    Unable to load image \SystemRoot\system32\ntkrnlpa.exe, Win32 error 0n2
    *** WARNING: Unable to verify timestamp for ntkrnlpa.exe
    *** ERROR: Module load completed but symbols could not be loaded for ntkrnlpa.exe
    Windows 7 Kernel Version 7601 (Service Pack 1) MP (4 procs) Free x86 compatible
    Product: WinNt, suite: TerminalServer SingleUserTS
    Built by: 7601.18205.x86fre.win7sp1_gdr.130708-1532
    Machine Name:
    Kernel base = 0x82e3e000 PsLoadedModuleList = 0x82f874d0
    Debug session time: Thu Apr 24 13:36:18.672 2014 (UTC + 1:00)
    System Uptime: 0 days 0:00:38.703
    * Symbols can not be loaded because symbol path is not initialized. *
    * The Symbol Path can be set by: *
    * using the _NT_SYMBOL_PATH environment variable. *
    * using the -y <symbol_path> argument when starting the debugger. *
    * using .sympath and .sympath+ *
    Unable to load image \SystemRoot\system32\ntkrnlpa.exe, Win32 error 0n2
    *** WARNING: Unable to verify timestamp for ntkrnlpa.exe
    *** ERROR: Module load completed but symbols could not be loaded for ntkrnlpa.exe
    Loading Kernel Symbols
    Loading User Symbols
    Loading unloaded module list
    ************* Symbol Loading Error Summary **************
    Module name Error
    ntkrnlpa The system cannot find the file specified
    You can troubleshoot most symbol related issues by turning on symbol loading diagnostics (!sym noisy) and repeating the
    command that caused symbols to be loaded.
    You should also verify that your symbol search path (.sympath) is correct.
    * Bugcheck Analysis *
    Use !analyze -v to get detailed debugging information.
    BugCheck 50, {afa99150, 0, 88c557d7, 0}
    *** WARNING: Unable to verify timestamp for mssmbios.sys
    *** ERROR: Module load completed but symbols could not be loaded for mssmbios.sys
    *** WARNING: Unable to verify timestamp for mfehidk.sys
    *** ERROR: Module load completed but symbols could not be loaded for mfehidk.sys
    *** WARNING: Unable to verify timestamp for HipShieldK.sys
    *** ERROR: Module load completed but symbols could not be loaded for HipShieldK.sys
    ***** Kernel symbols are WRONG. Please fix symbols to do analysis.
    *** Either you specified an unqualified symbol, or your debugger ***
    *** doesn't have full symbol information. Unqualified symbol ***
    *** resolution is turned off by default. Please either specify a ***
    *** fully qualified symbol module!symbolname, or enable resolution ***
    *** of unqualified symbols by typing ".symopt- 100". Note that ***
    *** enabling unqualified symbol resolution with network symbol ***
    *** server shares in the symbol path may cause the debugger to ***
    *** appear to hang for long periods of time when an incorrect ***
    *** symbol name is typed or the network symbol server is down. ***
    *** For some commands to work properly, your symbol path ***
    *** must point to .pdb files that have full type information. ***
    *** Certain .pdb files (such as the public OS symbols) do not ***
    *** contain the required information. Contact the group that ***
    *** provided you with these symbols if you need this command to ***
    *** work. ***
    *** Type referenced: nt!_KPRCB ***
    *** Either you specified an unqualified symbol, or your debugger ***
    *** doesn't have full symbol information. Unqualified symbol ***
    *** resolution is turned off by default. Please either specify a ***
    *** fully qualified symbol module!symbolname, or enable resolution ***
    *** of unqualified symbols by typing ".symopt- 100". Note that ***
    *** enabling unqualified symbol resolution with network symbol ***
    *** server shares in the symbol path may cause the debugger to ***
    *** appear to hang for long periods of time when an incorrect ***
    *** symbol name is typed or the network symbol server is down. ***
    *** For some commands to work properly, your symbol path ***
    *** must point to .pdb files that have full type information. ***
    *** Certain .pdb files (such as the public OS symbols) do not ***
    *** contain the required information. Contact the group that ***
    *** provided you with these symbols if you need this command to ***
    *** work. ***
    *** Type referenced: nt!_KPRCB ***
    *** Either you specified an unqualified symbol, or your debugger ***
    *** doesn't have full symbol information. Unqualified symbol ***
    *** resolution is turned off by default. Please either specify a ***
    *** fully qualified symbol module!symbolname, or enable resolution ***
    *** of unqualified symbols by typing ".symopt- 100". Note that ***
    *** enabling unqualified symbol resolution with network symbol ***
    *** server shares in the symbol path may cause the debugger to ***
    *** appear to hang for long periods of time when an incorrect ***
    *** symbol name is typed or the network symbol server is down. ***
    *** For some commands to work properly, your symbol path ***
    *** must point to .pdb files that have full type information. ***
    *** Certain .pdb files (such as the public OS symbols) do not ***
    *** contain the required information. Contact the group that ***
    *** provided you with these symbols if you need this command to ***
    *** work. ***
    *** Type referenced: nt!_KPRCB ***
    Probably caused by : mfehidk.sys ( mfehidk+377d7 )
    Followup: MachineOwner
    1: kd> kd: Reading initial command '!analyze -v;q'
    * Bugcheck Analysis *
    PAGE_FAULT_IN_NONPAGED_AREA (50)
    Invalid system memory was referenced. This cannot be protected by try-except,
    it must be protected by a Probe. Typically the address is just plain bad or it
    is pointing at freed memory.
    Arguments:
    Arg1: afa99150, memory referenced.
    Arg2: 00000000, value 0 = read operation, 1 = write operation.
    Arg3: 88c557d7, If non-zero, the instruction address which referenced the bad memory
    address.
    Arg4: 00000000, (reserved)
    Debugging Details:
    ***** Kernel symbols are WRONG. Please fix symbols to do analysis.
    *** Either you specified an unqualified symbol, or your debugger ***
    *** doesn't have full symbol information. Unqualified symbol ***
    *** resolution is turned off by default. Please either specify a ***
    *** fully qualified symbol module!symbolname, or enable resolution ***
    *** of unqualified symbols by typing ".symopt- 100". Note that ***
    *** enabling unqualified symbol resolution with network symbol ***
    *** server shares in the symbol path may cause the debugger to ***
    *** appear to hang for long periods of time when an incorrect ***
    *** symbol name is typed or the network symbol server is down. ***
    *** For some commands to work properly, your symbol path ***
    *** must point to .pdb files that have full type information. ***
    *** Certain .pdb files (such as the public OS symbols) do not ***
    *** contain the required information. Contact the group that ***
    *** provided you with these symbols if you need this command to ***
    *** work. ***
    *** Type referenced: nt!_KPRCB ***
    *** Either you specified an unqualified symbol, or your debugger ***
    *** doesn't have full symbol information. Unqualified symbol ***
    *** resolution is turned off by default. Please either specify a ***
    *** fully qualified symbol module!symbolname, or enable resolution ***
    *** of unqualified symbols by typing ".symopt- 100". Note that ***
    *** enabling unqualified symbol resolution with network symbol ***
    *** server shares in the symbol path may cause the debugger to ***
    *** appear to hang for long periods of time when an incorrect ***
    *** symbol name is typed or the network symbol server is down. ***
    *** For some commands to work properly, your symbol path ***
    *** must point to .pdb files that have full type information. ***
    *** Certain .pdb files (such as the public OS symbols) do not ***
    *** contain the required information. Contact the group that ***
    *** provided you with these symbols if you need this command to ***
    *** work. ***
    *** Type referenced: nt!_KPRCB ***
    *** Either you specified an unqualified symbol, or your debugger ***
    *** doesn't have full symbol information. Unqualified symbol ***
    *** resolution is turned off by default. Please either specify a ***
    *** fully qualified symbol module!symbolname, or enable resolution ***
    *** of unqualified symbols by typing ".symopt- 100". Note that ***
    *** enabling unqualified symbol resolution with network symbol ***
    *** server shares in the symbol path may cause the debugger to ***
    *** appear to hang for long periods of time when an incorrect ***
    *** symbol name is typed or the network symbol server is down. ***
    *** For some commands to work properly, your symbol path ***
    *** must point to .pdb files that have full type information. ***
    *** Certain .pdb files (such as the public OS symbols) do not ***
    *** contain the required information. Contact the group that ***
    *** provided you with these symbols if you need this command to ***
    *** work. ***
    *** Type referenced: nt!_KPRCB ***
    ADDITIONAL_DEBUG_TEXT:
    You can run '.symfix; .reload' to try to fix the symbol path and load symbols.
    MODULE_NAME: mfehidk
    FAULTING_MODULE: 82e3e000 nt
    DEBUG_FLR_IMAGE_TIMESTAMP: 4d2e1e3e
    READ_ADDRESS: GetPointerFromAddress: unable to read from 00000000
    GetPointerFromAddress: unable to read from 00000000
    unable to get nt!MmSpecialPoolStart
    unable to get nt!MmSpecialPoolEnd
    unable to get nt!MmPagedPoolEnd
    unable to get nt!MmNonPagedPoolStart
    unable to get nt!MmSizeOfNonPagedPoolInBytes
    afa99150
    FAULTING_IP:
    mfehidk+377d7
    88c557d7 0fb70c06 movzx ecx,word ptr [esi+eax]
    MM_INTERNAL_CODE: 0
    CUSTOMER_CRASH_COUNT: 1
    DEFAULT_BUCKET_ID: WIN7_DRIVER_FAULT
    BUGCHECK_STR: 0x50
    CURRENT_IRQL: 0
    ANALYSIS_VERSION: 6.3.9600.17298 (debuggers(dbg).141024-1500) x86fre
    LAST_CONTROL_TRANSFER: from 82e7eaa8 to 82ecb879
    STACK_TEXT:
    WARNING: Stack unwind information not available. Following frames may be wrong.
    ad0baf90 82e7eaa8 00000000 afa99150 00000000 nt+0x8d879
    ad0bafa8 88c557d7 badb0d00 00000000 88c4ceb0 nt+0x40aa8
    ad0bb040 88c4f97d 001a99b0 afa91000 00000000 mfehidk+0x377d7
    ad0bb090 88c52b16 00770220 ad0bb0fc 00000010 mfehidk+0x3197d
    ad0bb0bc 98d5fb73 ae770220 ad0bb0fc 00000010 mfehidk+0x34b16
    ad0bb140 98d5fc43 ae738c30 98d6b62a aace7220 HipShieldK+0xb73
    ad0bb168 98d6b882 ad0bb19c 00000000 98d77b44 HipShieldK+0xc43
    ad0bb1b8 98d631a9 00000bd4 0000102c ad0bb208 HipShieldK+0xc882
    ad0bb330 88c47795 00000bd4 0000102c ad0bb401 HipShieldK+0x41a9
    ad0bb400 88c22b57 0000102c ad0bb460 85b3dee0 mfehidk+0x29795
    ad0bb41c 88c232c6 ad0bb430 0000000c 8c4b6ce0 mfehidk+0x4b57
    ad0bb43c 830a5acb adb6b9b8 0000102c ad0bb460 mfehidk+0x52c6
    ad0bb4f4 830adaf8 adb16030 01b6b9b8 ad0bb550 nt+0x267acb
    ad0bbc00 82e7b8c6 038ae710 038ae6ec 02000000 nt+0x26faf8
    ad0bbc34 77a470f4 badb0d00 038ae3dc 00000000 nt+0x3d8c6
    ad0bbc38 badb0d00 038ae3dc 00000000 00000000 0x77a470f4
    ad0bbc3c 038ae3dc 00000000 00000000 00000000 0xbadb0d00
    ad0bbc40 00000000 00000000 00000000 00000000 0x38ae3dc
    STACK_COMMAND: kb
    FOLLOWUP_IP:
    mfehidk+377d7
    88c557d7 0fb70c06 movzx ecx,word ptr [esi+eax]
    SYMBOL_STACK_INDEX: 2
    SYMBOL_NAME: mfehidk+377d7
    FOLLOWUP_NAME: MachineOwner
    IMAGE_NAME: mfehidk.sys
    BUCKET_ID: WRONG_SYMBOLS
    FAILURE_BUCKET_ID: WRONG_SYMBOLS
    ANALYSIS_SOURCE: KM
    FAILURE_ID_HASH_STRING: km:wrong_symbols
    FAILURE_ID_HASH: {70b057e8-2462-896f-28e7-ac72d4d365f8}
    Followup: MachineOwner
    quit:
    output when run in my app:-
    Microsoft (R) Windows Debugger Version 6.3.9600.17298 X86
    Copyright (c) Microsoft Corporation. All rights reserved.
    Loading Dump File [C:\Windows\MiniDump\042414-24632-01.dmp]
    Mini Kernel Dump File: Only registers and stack trace are available
    Symbol search path is: *** Invalid ***
    * Symbol loading may be unreliable without a symbol search path. *
    * Use .symfix to have the debugger choose a symbol path. *
    * After setting your symbol path, use .reload to refresh symbol locations. *
    Executable search path is:
    * Symbols can not be loaded because symbol path is not initialized. *
    * The Symbol Path can be set by: *
    * using the _NT_SYMBOL_PATH environment variable. *
    * using the -y <symbol_path> argument when starting the debugger. *
    * using .sympath and .sympath+ *
    Unable to load image \SystemRoot\system32\ntkrnlpa.exe, Win32 error 0n2
    *** WARNING: Unable to verify timestamp for ntkrnlpa.exe
    *** ERROR: Module load completed but symbols could not be loaded for ntkrnlpa.exe
    Windows 7 Kernel Version 7601 (Service Pack 1) MP (4 procs) Free x86 compatible
    Product: WinNt, suite: TerminalServer SingleUserTS
    Built by: 7601.18205.x86fre.win7sp1_gdr.130708-1532
    Machine Name:
    Kernel base = 0x82e3e000 PsLoadedModuleList = 0x82f874d0
    Debug session time: Thu Apr 24 13:36:18.672 2014 (UTC + 1:00)
    System Uptime: 0 days 0:00:38.703
    * Symbols can not be loaded because symbol path is not initialized. *
    * The Symbol Path can be set by: *
    * using the _NT_SYMBOL_PATH environment variable. *
    * using the -y <symbol_path> argument when starting the debugger. *
    * using .sympath and .sympath+ *
    Unable to load image \SystemRoot\system32\ntkrnlpa.exe, Win32 error 0n2
    *** WARNING: Unable to verify timestamp for ntkrnlpa.exe
    *** ERROR: Module load completed but symbols could not be loaded for ntkrnlpa.exe
    Loading Kernel Symbols
    Loading User Symbols
    Loading unloaded module list
    ************* Symbol Loading Error Summary **************
    Module name Error
    ntkrnlpa The system cannot find the file specified
    You can troubleshoot most symbol related issues by turning on symbol loading diagnostics (!sym noisy) and repeating the
    command that caused symbols to be loaded.
    You should also verify that your symbol search path (.sympath) is correct.
    * Bugcheck Analysis *
    Use !analyze -v to get detailed debugging information.
    BugCheck 50, {afa99150, 0, 88c557d7, 0}
    *** WARNING: Unable to verify timestamp for mssmbios.sys
    *** ERROR: Module load completed but symbols could not be loaded for mssmbios.sys
    *** WARNING: Unable to verify timestamp for mfehidk.sys
    *** ERROR: Module load completed but symbols could not be loaded for mfehidk.sys
    *** WARNING: Unable to verify timestamp for HipShieldK.sys
    *** ERROR: Module load completed but symbols could not be loaded for HipShieldK.sys
    ***** Kernel symbols are WRONG. Please fix symbols to do analysis.
    *** Either you specified an unqualified symbol, or your debugger ***
    *** doesn't have full symbol information. Unqualified symbol ***
    *** resolution is turned off by default. Please either specify a ***
    *** fully qualified symbol module!symbolname, or enable resolution ***
    *** of unqualified symbols by typing ".symopt- 100". Note that ***
    *** enabling unqualified symbol resolution with network symbol ***
    *** server shares in the symbol path may cause the debugger to ***
    *** appear to hang for long periods of time when an incorrect ***
    *** symbol name is typed or the network symbol server is down. ***
    *** For some commands to work properly, your symbol path ***
    *** must point to .pdb files that have full type information. ***
    *** Certain .pdb files (such as the public OS symbols) do not ***
    *** contain the required information. Contact the group that ***
    *** provided you with these symbols if you need this command to ***
    *** work. ***
    *** Type referenced: nt!_KPRCB ***
    *** Either you specified an unqualified symbol, or your debugger ***
    *** doesn't have full symbol information. Unqualified symbol ***
    *** resolution is turned off by default. Please either specify a ***
    *** fully qualified symbol module!symbolname, or enable resolution ***
    *** of unqualified symbols by typing ".symopt- 100". Note that ***
    *** enabling unqualified symbol resolution with network symbol ***
    *** server shares in the symbol path may cause the debugger to ***
    *** appear to hang for long periods of time when an incorrect ***
    *** symbol name is typed or the network symbol server is down. ***
    *** For some commands to work properly, your symbol path ***
    *** must point to .pdb files that have full type information. ***
    *** Certain .pdb files (such as the public OS symbols) do not ***
    *** contain the required information. Contact the group that ***
    *** provided you with these symbols if you need this command to ***
    *** work. ***
    *** Type referenced: nt!_KPRCB ***
    *** Either you specified an unqualified symbol, or your debugger ***
    *** doesn't have full symbol information. Unqualified symbol ***
    *** resolution is turned off by default. Please either specify a ***
    *** fully qualified symbol module!symbolname, or enable resolution ***
    *** of unqualified symbols by typing ".symopt- 100". Note that ***
    *** enabling unqualified symbol resolution with network symbol ***
    *** server shares in the symbol path may cause the debugger to ***
    *** appear to hang for long periods of time when an incorrect ***
    *** symbol name is typed or the network symbol server is down. ***
    *** For some commands to work properly, your symbol path ***
    *** must point to .pdb files that have full type information. ***
    *** Certain .pdb files (such as the public OS symbols) do not ***
    *** contain the required information. Contact the group that ***
    *** provided you with these symbols if you need this command to ***
    *** work. ***
    *** Type referenced: nt!_KPRCB ***
    Probably caused by : mfehidk.sys ( mfehidk+377d7 )
    Followup: MachineOwner
    Darren Rose

    Try it by opening the Cmd prompt as the actual process and passing the Filename and its arguments as the arguments of the Cmd process.  If you notice there is a "-C" before the Filename and Arguments in this example.  The "-C"
    tells the cmd to execute the commands and then close itself.  You can also use a "-K" which tells the cmd to execute the commands and keep itself open.  Being you are not showing the cmd window you don`t want to keep it opened because the
    user can`t close it so, that is why i used "-C".
     I don`t have the program so, you can just experiment to see what it does.  Maybe you should try using "-K" and show the cmd window by commenting out the CreateNoWindow line so you can see what is in the cmd window while testing.
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    Dim filepath As String = """C:\Program Files (x86)\Windows Kits\8.1\Debuggers\x86\kd"""
    Dim args As String = " -z C:\windows\minidump\042414-24632-01.dmp -c ""!analyze –v;q"""
    Dim p As New Process
    With p.StartInfo
    .FileName = "cmd.exe"
    .Arguments = "-c " & filepath & args
    .UseShellExecute = False
    .CreateNoWindow = True
    .RedirectStandardOutput = True
    End With
    p.Start()
    TextBox1.Text = p.StandardOutput.ReadToEnd
    End Sub
    If you say it can`t be done then i`ll try it

  • Is there a way to run dos commands on onther system?

    Hi I have connected to a port of another system where windows is the operating system. So can I run dos commands on the other system through that network connection from my computer?

    I'm not sure what you mean by "connected to a port of another system" . Which port using what software to which server?

  • Error while running Snapshot Command

    We have Create a MDX Query in Model Designer to display Revenue and Demand Plan units from Demand cube.
    SELECT{ [FiscalCalendar].[FiscalCalendar]} ON COLUMNS,
    { CROSSJOIN({ [Product].[Product] },
    { [Measures].[Revenue Plan],
    [Measures].[Demand Plan Units] })}
    ON ROWS FROM [Demand] QUERY PROPERTIES flattenColumns=true
    and while running a query it is giving correct Output
    Row Count: 2
    Product Measures FiscalCalendar
    Product Revenue Plan $3,777,202,750.00
    Product Demand Plan Units 7,515,860
    On we Logging into Isadmin environment and run a snapshot command which gives error.
    Admin> snapshot data using query test (Our Query name)
    it does not work and gives error, please suggest a valid way to run this command.

    We ran into this, too. It was filed as a bug and will be fixed in the PS1 release (11.1.2.1). Oracle wouldn't commit to a release date tho. As this is core functionality, it would be good if you raised it with Oracle support. This will make it easier to lobby for a patch.
    Edited by: matt on Dec 29, 2010 4:23 PM

  • Error while running the SAP JCO java program running via command line

    Hi,
        We are facing an issue while using SAP JCO. When i try to run the sample program using RAD 8.0 ( IBM IDE tool For Java Development) its working fine.
    The same sample program if i try to run using command line, Then its giving below exception message.
    Exception in thread "main" java.lang.NoClassDefFoundError: Integration
    NOTE: I have configured proper sapjco jar & Dll files path in class path settings in my batch file.

    Hi,
    class loader can't find class definition during runtime but it could find it during compilation. So the problem is with your classpath. Does your classpath point to file with class Integration? Check this [blog|http://javarevisited.blogspot.com.au/2011/06/noclassdeffounderror-exception-in.html].
    Cheers
    Added reference to blog.

  • How to use addKeyListener in a program running using command prompt

    Does anyone have any idea how to add the addKeyListener to a program running using command prompt.
    Let me explain how the program run.
    The program is start and accept call from other program. But from time to time, I need to issue some command by pressing the keyboard, let say, ESC is closed the program, F1 is showing the stated. F2.... (This is all need to run in the command prompt windows)
    My problem is this program does not have any gui interface, so how can it be added?
    i do it this way
    public void key(){          
    addKeyListener(this);
    But it have compile error.
    mainServerImpl.java:87: cannot resolve symbol
    symbol : method addKeyListener (mainServerImpl)
    location: class mainServerImpl
    addKeyListener(this);
    I did implement KeyListener. But just don't know how to solve this error.
    can anyone tell me how to solve it or point me a source that can help.
    Thank in advance!
    Regards,
    Tai Tan

    Write your own Thread, to do this:
    public class KeyThread extends Thread {
       public void run {
          while(true) {
             int i = System.in.read();
             if(i == 123) {
                break; // to stop the thread
    // in your main:
    Thread keyThread = new KeyThread();
    keyThread.start(); // calls run() of the thread

  • FTP - Run OS Command before file processing

    Hi,
    I have a requirement wherein I need to FTP a file from XI to a folder in a FTP server . Now FTP Server is set up in such a way that I cannot put the file directly. Before transferring the file , I have to use CD ( change directory command ) to access a particular folder and then transfer the file. This means that I cannot give the folder information directly to TARGET DIRECTORY.
    To address this, I decided to use the feature "Run OS Command BEFORE file processing " . And wrote a command 'cd <foldername> .It is not working. Then I tried using "Run OS Command AFTER file processing "  and it also didnot work.
    Does anyone have any clue how can I address this requirement using FILE Adapter.
    thanks,
    rakesh

    HI,
    OS commands will be executed in XI server not in the FTP server. So first you need to connect into FTP server and then you need execute CD command.
    option 1) Get the absolute path ie direct path from FTP server so that you can directly connect to FTP server's specific directoty
    22) In this case , write the file into your XI server itself by NFS File Transport protocol. Then ftp this file from your XI server into FTP server using Shell Script.
    So write a shell script which will be executed in the XI server, inside this write a logic of tranfer of files with FTP protocol. This shell script is executed from the Reciever File adapter with the option OS command.
    Hope this helps,
    Regards,
    Moorthy

  • Running ssh command from java and then answering password prompt

    Hi,
    I have a situation that has not solved yet. I am running ssh command from unix terminal without any problem, and then i enter password.
    For example :
    [oracle@fuata]:/export/home/oracle> ssh -N [email protected] -L 9901:127.0.0.1:9999
    Password:
    It is working. I have question that how can i perform this in java? I am thinking that i can run ssh command by using Runtime Class, it is ok. But how can i answer the password? I am a bit confused. Is there any example looks like this?
    Thanks for responses.

    futi wrote:
    Thanx. Firstly i insisted to do this without jsch but actually this is harder than jsch. I edit some of code pieces PortForwardingL.java and could run it. It works problem-free. Could you say why you "insisted" on this approach. It can't be for speed+ since jsch is very fast. It can't be for portability+ since jsch is portable but the use of Runtime.exec() requires the installation of ssh software. It can't be because of limitations+ since jsch is a fully featured library. It can't be for security+ since jsch is secure. It can't be for ease of use+ since jsch is much easier to use than ssh with Runtime.exec(). Unless it's a licensing issue, it can't be for commercial+ reasons since jsch is free. The only reason I can think of why one would "insisted" on this approach is if it is for some college project.

  • Running ls command from Java stroed procedure no output

    Hi ,
    I am trying to run ls command from java stored procedure in oracle
    Process p = Runtime.getRuntime().exec("ls");
    BufferedReader stdInput = new BufferedReader(new
    InputStreamReader(p.getInputStream()));
    BufferedReader stdError = new BufferedReader(new
    InputStreamReader(p.getErrorStream()));
    // read the output from the command
    System.out.println("output of the command run:\n");
    while ((s = stdInput.readLine()) != null) {
    System.out.println(s);
    from java stored procedure in oracle.
    i get output of println statments but it does not go into while loop to print from stdInput.
    Result of running Java stored procedure is -
    output of the command run:
    Call completed.
    when i run the program on client side it works fine.
    Has anybody tried this from java stroed procedure.
    Thanks,
    Jag

    Jag,
    Actually, the question of whether it works for me seems to depend on the version of the OS (or Oracle). On RedHat Linux (Oracle 8.1.6) it didn't work at all, but on Solaris (Oracle 9.0.2) it did. Here's the output from that run:
    SQL> /
    output of the command run:
    init.ora
    initDBPart9i.DBPSun01.ora
    initdw.ora
    lkDBPART9I
    orapw
    orapwDBPart9i
    spfileDBPart9i.ora
    Done
    PL/SQL procedure successfully completed.
    But, I did need to change a line of your code to this:
    Process p = Runtime.getRuntime().exec("/usr/bin/ls");
    your original was:
    Process p = Runtime.getRuntime().exec("ls");
    You might consider, if possible, use of some of the Java File classes instead of ls, as this might make things more predictable for you. There were some examples in oramag.com a few months ago, but they were pretty simple (you might not need them).
    Hope this helps,
    -Dan
    http://www.compuware.com/products/devpartner/db/oracle_debug.htm
    Debug PL/SQL and Java in the Oracle Database

  • Running ssh command in a java application

    Hi there!
    I am trying to run a ssh command from a java application cause I need to store the result.
    Actually I can run this command in the cygwin shell so I need to open the shell and run the command, all trough java.
    so, what my process needs to do is:
    1) open the cmd
    2) run C:\cygwin\cygwin.bat
    3) execute the ssh command
    ssh -l fip-user ipdb fip 42704) print the result of the ssh command.
    Note that the cygwin opens in the same command line window and so will print it's result to the same process inputstream
    Message was edited by:
    RBervini

    Use "Runtime.getRuntime().exec()" to execute the SSH program,
    and you can then get the output of the SSH program
    via the getInputStream() method on the returned Process object.
    Note: there are many pitfalls with this. In particular, most people don't know
    they should create separate threads to drain the input/output pipes.
    See this excellent classic article http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html
    on how to do it right.

Maybe you are looking for