Can't execute windows command in servlet with JDK1.5 and tomcat 5

Hi all,
I have a web application which uses a servlet to execute windows commands, such as "mkdir", "mv", and "rmdir". In my servlet, I use java Runtime() class to implement the execution.
Under jsdk1.4 and tomcat 4, it is fine for the servlet to execute those command. But uncer jdk1.5 and tomcat 5, it gives the following error:
error to execute a command: java.io.IOException: CreateProcess: mkdir c:\m7q28 error=2
java.io.IOException: CreateProcess: mkdir c:\m7q28 error=2
Please help me if you have any idea. Thanks.

And be sure to read this:
http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html

Similar Messages

  • Execute a command from servlet

    Hello,
    How can I execute this command from a servlet ?
    example: I want execute "java -cp /root/:/root/log/api/:/root/log/apps/ Transmitter" when I lunch servlet1.java
    so which class in JAVA can do this ?
    Thanks ?

    why u want to run another program? Usually you call the methods within the second program.
    Is it possible to invoke another program in the server using a servlet? If so it could even mess up the whole server. I am not sure.

  • Can AIR execute Windows .EXE files?

    Can AIR execute Windows .EXE files?

    hi
    you can now implement a standard windows installer (ie a native installer, rather than the AIR installer) when users install your AIR app. Not sure if there's an option to do this in flex/flash builder but it can be done via command line.
    eg:
    adt -package -storetype pkcs12 -keystore myCert.p12 -target native NativeProcessTest.exe NativeProcessTest-app.xml NativeProcessTest.swf NativeApps/Windows/bin/echoTestWindows icons
    or try this handy packager:
    http://www.webkitchen.be/package-assistant-pro/

  • Sudo can't execute some commands[SOLVED]

    Hi Archers,
    I am using sudo and disable root account. There is some problems with sudo such as the following commands:
    #sudo echo "1234"  >/etc/rc.local
    # sudo cd /root
    I can't execute these commands with sudo, instead i have to login as root and execute the commands. So the question is how can I solve these problems?
    The Second issue is how can I give certain user the commands that they can execute. For example, user A is only allowed to use "ls" commands and not any other commands?
    Cheers
    Last edited by hungsonbk (2008-11-17 02:02:29)

    You can't use those commands because it aren't real commands, it are shell builtins and they are ran by your shell which is ran by your regular user.
    sudo echo foo > bar
    This runs the "echo" binary as root but the ">" part is handled by the shell, appropriate way to handle this:
    echo foo|sudo tee bar
    cd wont work neither, if it did you could cd to a directory you don't have permissions to and then you would be in their as regular user, unable to do anything... You should just work from outside /root or use sudo -s.
    For the user thing: man sudoers.
    Last edited by Ramses de Norre (2008-11-15 16:52:55)

  • How can i Downgrade Windows 8 to 7 with hp elitepad 900?

    how can i Downgrade Windows 8 to 7 with hp elitepad 900?  if i connect external dvdrrom is not show on booting option

    Most likely because of the UEFI used in Windows 8.  It is not by coincidence that this happens.  Look at this to help: http://distrowatch.com/weekly.php?issue=20121126#q​a
    {---------- Please click the "Thumbs Up" to say thanks for helping.
    Please click "Accept As Solution" if my help has solved your problem. ----------}
    This is a user supported forum. I am a volunteer and I do not work for HP.

  • Can I install Windows 8 (DEMO) on a MAC and play windows based games ?

    Can I install Windows 8 (DEMO) on a MAC and play windows based games ?

    I installed the Developer beta with Bootcamp Assistant yesterday and was very impressed with the ease of the installation. Unfortunately, and I don't know if this is a problem with my video BIOS on my Macbook Air, but Windows 8 installs with two screens split horizontally - so it's effectively useless.
    I tried 3 times and gave up. The same thing happens with Linux distributions, however with Linux I can pass "nomodeset" on the kernel command line which fixes it. I don't know how to do that in Windows.
    This was happening with both 64x and 32-bit Win8 fwiw.
    Oh, also...when I was trying to play around with Bootcamp.exe inside Windows 8, I remember a message popping up saying Bootcamp is only configurable with Windows 7 ISOs. But aside from the kernel graphics issues and some driver compatibility problems, Bootcamp loaded the Win8 ISOs fine.

  • HT1846 The 2012 Mac Mini's are listed on this article. Can I run windows 7 64-bit on it and/or the 32-bit?

    The 2012 Mac Mini's are listed on this article. Can I run windows 7 64-bit on it and/or the 32-bit?

    I would buy nothing less than Windows 7 64-bit Pro.
    32-bit only addresses 3.5 GB RAM ... 2012 Macminis can hold 16 GB.
    64-bit Home addresses 16 GB RAM.
    64-bit Pro addresses 192 GB RAM and han an XP mode.
    This is all about having a good version of Windows for future use.  Yu can buy "Syem Builder" version of 64-bit Pro for $140.

  • How can I resize a pdf page content with annotations and highlights in Acrobat Pro?

    How can I resize a pdf page content with annotations and highlights in Acrobat Pro while maintaining page size and annotation/highlight interactivity? I've tried to use the crop tool in Acrobat Pro (9) and the page does resize, but the highlights and annotations go all over the place. I specifically need to scale the page content smaller (83%) but maintain page size and annotation/highlight to content connection and interactivity.

    An old trick (not recommended) would be to print to a new PDF with the page size selected but a scaling of the content. Only print the document, not the markup, to a new PDF. Close that PDF when done and reopen the old one (or maybe a copy of the old one for safety) and use Document Replace pages and select the new document to replace your current pages. You will then have to go back through the markup to locate it all correctly. There may be a more elegant way, but this may be the fastest.

  • S10e -- Can I install Windows XP onto my Linux-Netbook and same way Linux on Windows Netbook?

    Hello all,
    I wanna buy a S10e and I still have one question:  
    Can I install Windows XP onto my Linux-Netbook and same way Linux on my Windows Netbook?
    I wanna use Suse for all my net applications and still wanna Windows for just old games running on a long trip as flights ect..
    Is it possible? Install booth?
    Thanks 
    Message Edited by ykin on 01-24-2009 12:43 PM

    Boot Camp will only let you install onto an internal disk. This is largely because of Windows restrictions, not Mac OS restrictions. The beta thread has some supposed approaches to let you do this, using manual steps instead of using Boot Camp Assistant.
    Doug

  • How can I pair iPhone 6  / 8.1 with Audi and Mercedes until 8.1 is fixed?

    How can I pair iPhone 6/8.1 with Audi and Mercedes

    Generally your put the vehicle into discovery mode, turn Bluetooth on for the phone and the two should discover each other. I don't know what you mean about getting 8.1 fixed, as it is working just fine for me in my vehicle. Try going into the phone and removing the car(s) from the phone list. Turn off Bluetooth. Go into Settings>General>Reset Network Settings. Do a reset on the phone, hold the sleep/wake and home buttons together until you see the Apple Logo and release. The phone will reboot. Go into the vehicle(s) and remove all reference to the phone from the vehicle list. Turn the car off, then back on. Put the vehicle's system into discovery/pairing mode. Turn Bluetooth on for the iPhone. The two should pair after following any additional instructions from the vehicle's user guide, such as entering a PIN code.

  • Hi All, can i have some production support issues with rootcasue and resolution for SAP TM?

    Hi All, can i have some production support issues with rootcasue and resolution for SAP TM?
    Thanks,
    Sreenivas

    Hi Sreenivas,
    I would recommend that you read the Rules of Engagement and other documents in the Getting Started link (top right) before posting anymore.  Your Discussion will most likely get reported as non-specific and get removed.  If you have a specific problem with TM, please post it in a new thread with error messages, version and SPs installed, and how the error occurs and what you are trying to get TM to do.
    There are a lot of resources available in the TM Overview page which can help, so start there and maybe also look at some of the MKS (Monday Knowledge Session) recordings which should also be listed.  There are also a lot of experienced people who can help resolve issues your TM installation, but you need to provide enough information on the problems you are having.  If you are just looking for information on past problems, do a Search or simply browse through past Discussions which are marked with a green Check (Correct Answer).
    Regards, Mike
    SAP Customer Experience Group - CEG (and a Moderator)

  • I can not see my screen, but I can listen to notifications, listen to music with headphones, and my button locked not responds

    I can not see my screen, but I can listen to notifications, listen to music with headphones, and my button locked not responds

    I believe the keys on an imac are F11 and F12, for dark / bright respectively.
    Try that, I think it'll work.
    If not, then try out all the "F" keys, one of them will work.
    Ben

  • TS3999 how can I stop syncing my outlook calendar with icloud and not loose the existing calandar data in outlook?  the calendar data which downloads to outlook, was also wiped off the gmail calendar after the icloud sync , how can I restore the data to g

    How can I stop syncing my outlook calendar with iCloud and not lose the existing calendar data in outlook?  The calendar data which downloads to Outlook was also wiped off the Gmail calendar after the iCloud sync, how can I restore the data to Gmail?

    same issue, looks like nobody answered you from last JULY....

  • Help with executing windows command in java

    hi, i am trying to execute dos command in java. currently i am trying simply to create a folder in the current directory.
    here is the code snippet:
    try {
    Process p = Runtime.getRuntime().exec("md myFolder");
    } catch (IOException io) {
    io.printStackTrace();
    i have also tried using "mkdir" instead of "md". but my code just throws an exception that says:
    java.io.IOException: CreateProcess: md myFolder error=2
    what have I done wrong? thanks in advance

    try {
    Process p = Runtime.getRuntime().exec("cmd /c
    mkdir myFolder");
    catch (IOException io) {
    io.printStackTrace();hey! that code worked out perfectly. so "cmd" is needed to run dos commands? i searched through the net, but most of the examples that i were able to find did not include "cmd".
    if it wouldn't be too much trouble, what is the option "/c" for?
    i would also like to add that "mkdir" also works. The problem was the missing "cmd /c". Thanks guys for your help! I really appreciate it.

  • How can I execute a command inside of a VM client from the VM host?

    Hi!
    I'm working on a set of scripts to automate MOC classroom installations using MDT and PowerShell. Sofar I've been able to automate everything except for the Rearm needed within the VM Clients. Is there any command (preferably PowerShell) that I can Launch
    on the VM host with which I can execute a command within the VM Client?
    Regards,
    Gerrit Deike
    If you think your to small to make a differnce, try going to bed with a mosquito in the room...

    If you wanted the pings to run in parallel, you could have this applet configure another applet to do the pinging, then remove it on the last run.  This will require an amount of programmatic logic, though.  If you wanted to keep things a bit simpler, add another applet that runs at 22:00 that configures a watchdog pinging applet, then a third applet that runs at 22:10 that removes the pinging applet.
    When it comes to embedded quotes when you configure your nested pinging applet, you'll need to use $q to stand for the embedded quotes.  You'll also need to configure:
    event manager environment q "

Maybe you are looking for

  • Curve 8320

    I have lost my set up disc for my BB Curve 8320, where can I get a replacement? or the software?

  • SE48 and SE49 transactions..

    dear experts, from which version onwards the T.Codes SE48 and SE49 are available?... thaks in advance.

  • Firewire drives don't mount after 10.4.3 update

    G3 B&W OS 10.4.2 Everything working fine with 10.4.2. Two 3rd party external firewire drives mounted and working. Had not installed any 3rd party drivers. Updated to 10.4.3 and neither will mount. Don't show in System Profiler either. Is fix to "back

  • ESS-ITS services

    Hello All,        We have a standalone ITS(6.2).We have two instances with the same ip for the host ITS machine.       One of the instances is for r/3 4.7 for ESS.When we execute PZ02 through the browser,we get the same webgui screens.       Do we ha

  • How to write to the end of a file

    i am tryign to write to the end of a file using bufferwriter and bufferreadear. I am trying to the read the file until i reach the end and then write in the end. I have some code but i dont know how to read until the end of the file. File file = new