Open a command window and send some keystroke to the opened command window

Hi All,
I am trying to open command prompt and send some key stroke to that command prompt. Here I am using Robot to send keystroke. But the problem is, the keystrokes are not sent to the prompt. I guess I need to activate progamitically the command prompt to accept the keystrokes . Please find the code below ( as I did).
try
String command = "cmd.exe /c start";
Process child = Runtime.getRuntime().exec(command);
Robot robot = new Robot();
Thread.sleep(5000);
String lol = "indranil";
for(int i=0;i<lol.length();i++)
robot.keyPress(lol.charAt(i));
int g = lol.length() - 1;
robot.keyRelease(lol.charAt(g));
catch (Exception e) {}
I guess I am doing some mistake here while sending the keystroke/openning the command prompt. Can anyone please help me how can I open a command window and send some keystroke to the opened command window. I am in fix.
Thanks,
Indranil

The first thing to do is read the API and examples for the Robot class.
Also check out this thread with a similar discussion: [http://forums.sun.com/thread.jspa?threadID=5385677]
The short spoonfed answer - keyPress() and keyReleaseI() do not take chars. Read up on KeyEvent

Similar Messages

  • 1) I pressed Menu\Bookmarks\ShowAllBookmarks to open bookmarks organizer. 2) I pressed Ctrl-F to search for some bookmark(s) (e.g. newspaper domain) and found some. NOW The qustion is "Which folder this/these bookmark(s) are actually located in"?

    Salut!
    The scenario is "Find bookmark existed before and recall which bookmarkfolder it is in"
    Please note the "folder" is for "bookmarks", NOT a file folder of HDD-filesystem
    1) I pressed Menu\Bookmarks\ShowAllBookmarks to open bookmarks organizer.
    2) I pressed Ctrl-F to search for some bookmark(s) (e.g. newspaper domain) and found some.
    NOW The qustion is "Which folder this/these bookmark(s) are actually located in"?

    Hey, guys. Thanks for responding. I really didn't know I was so clueless about this stuff.
    I really thought "urxvt" could be used as an alias or, what we called in Debian, an alternative, to the rxvt-unicode-256color command. I guess not? I'm still trying to set up "vi" to be Vim as well, and I'll read more of the Wiki to figure that stuff out with Arch.
    So in the tty interface I can start zsh again just fine. That's old news. I removed the TERM setting and placed the resource in my .Xresources that derhamster said. Thanks.
    I also replaced the line in my Openbox rc.xml and menu.xml for terminal opening commands (can I use $TERM for those?)
    Now when I start Xorg (with Openbox running) I tried both urxvt-unicode-256color and urxvt but none of them work with Openbox. No terminal emulator pops up and no errors show that I can see.
    Last edited by mrrhq (2012-11-13 18:34:29)

  • Why the fifa 2014 apps suddenly started and after some seconds stopped "the window of the game minimized to the desktop toolbar

    Hello to you
    I have download game apps fifa 2014 from the app store of windows 8.1 32x  on my laptop.
     However, the game started to the mane screen and stopped suddenly.
     The window of the game minimized to the manager toolbar on desktop and win I click on it the game work from the beginning and stopped like the first time and didn't work  
    Why the fifa 2014 apps suddenly started and after some seconds stopped "the window of the game minimized to the desktop toolbar  
       System Information Report
    عام        
                    نظام التشغيل        Microsoft Windows 8.1 Pro
                    المعالج المركزي        Intel(R) Core(TM) i3-2330M CPU @ 2.20GHz
                    اسم المستخدم        amjad
    العرض        
                    وصلة الفيديو        Intel(R) HD Graphics 3000
                    ذاكرة الفيديو        1.15 GB
                    دقة الشاشة        1366 x 768
    التخزين        
                    إجمالي الذاكرة        2.67 GB
                    الذاكرة الحرة        1.05 GB
                    مساحة القرص الصلب        296.54 GB
                    المساحة الحرة        176.65 GB
    I/O        
                    الفأرة        Samsung PS/2 Port Input Device
                    لوحة المفاتيح        Standard PS/2 Keyboard
    نظام الكمبيوتر        
                    اسم الكمبيوتر        SUMSUNG-I3
                    اسم المستخدم        [email protected]
                    المنظمة        N/A
    نظام التشغيل        
                    اسم نظام التشغيل        Microsoft Windows 8.1 Pro
                    إصدار نظام التشغيل        6.3.9600
                    معرّف المنتج        00261-50000-00000-AA602
                    وقت تشغيل النظام        17/06/2014 23:34:21
                    إصدار الأنترنت إكسبلورر        11.0.9600.17126
                    DirectX إصدار        DirectX 11
                    OpenGL إصدار        6.3.9600.16384 (winblue_rtm.130821-1623)
    الريجستري        
                    أقصى حجم        682 MB
                    الحجم الحالي        104 MB
                    الحالة        OK
    المعالج المركزي        
                    اسم المعالج        Intel(R) Core(TM) i3-2330M CPU @ 2.20GHz
                    اسم الكود        N/A
                    المنتج        GenuineIntel
                    السرعة الحالية        2200 Mhz
                    أقصى سرعة        2200 Mhz
                    Voltage        1.2V
                    الساعة الخارجية        100 Mhz
                    الرقم التسلسل        BFEBFBFF000206A7
                    معرّف المعالج        x64 Family 6 Model 42 Stepping 7
                    مأخذ التوصيل        CPU
                    L1-Cache        64 KB
                    L2-Cache        256 KB
                    L3-Cache        3072 KB
    اللوحة الأم        
                    الطراز        300E4A/300E5A/300E7A
                    المنتج        SAMSUNG ELECTRONICS CO., LTD.
                    الرقم التسلسل        123490EN400015
                    BIOS اسم        Phoenix SecureCore-Tiano(tm) NB Version 2.1 01QA
                    BIOS منتج        Phoenix Technologies Ltd.
                    SMBIOS إصدار        01QA
                    BIOS تاريخ        05/09/2011
    BIOS ميزات        
                    PCI is supported        نعم
                    BIOS is Upgradable (Flash)        نعم
                    BIOS shadowing is allowed        نعم
                    Boot from CD is supported        نعم
                    Selectable Boot is supported        نعم
                    EDD (Enhanced Disk Drive) Specification is supported        نعم
                    Int 5h, Print Screen Service is supported        نعم
                    Int 9h, 8042 Keyboard services are supported        نعم
                    Int 14h, Serial Services are supported        نعم
                    Int 17h, printer services are supported        نعم
                    Int 10h, CGA/Mono Video Services are supported        نعم
                    NEC PC-98        نعم
                    ACPI supported        نعم
                    USB Legacy is supported        نعم
    مورد الذاكرة        
                    إجمالي الذاكرة        2.67 GB
                    الذاكرة المستخدمة        1.62 GB
                    الذاكرة الحرة        1.05 GB
                    استخدام الذاكرة        60%
    الذاكرة الفعلية        
                    صرف الذاكرة        BANK 0
                    الوصف        Physical Memory 0
                    محدد الجهاز        ChannelA-DIMM0
                    المساحة        2.00 GB
                    السرعة        1333 Mhz
                    المنتج        Hynix/Hyundai
                    عرض البيانات        64 bit
                    نوع الذاكرة        Unknown
                    عامل النموذج        SODIMM
    الذاكرة الفعلية        
                    صرف الذاكرة        BANK 2
                    الوصف        Physical Memory 2
                    محدد الجهاز        ChannelB-DIMM0
                    المساحة        2.00 GB
                    السرعة        1333 Mhz
                    المنتج        Hynix/Hyundai
                    عرض البيانات        64 bit
                    نوع الذاكرة        Unknown
                    عامل النموذج        SODIMM
    الأقراص الصلبة        
                    الاسم        SAMSUNG HM321HI
                    نوع الوسائط        Fixed hard disk media
                    الحجم الكلي        298.09 GB
                    نوع الواجهة        IDE
                    عدد الأقراص        3
                    إجمالي الأسطوانات        38913
                    إجمالي الكليّة        255
                    إجمالي القطاعات        625137345
                    مجموع المسارات        9922815
                    المسارات لكل اسطوانة        255
                    بايت لكل قطاع        512
                    قطاعات لكل مسار        63
                    S.M.A.R.T دعم        نعم
                    درجة الحرارة الحالية        0C (32F)
    CD-ROM Drive        
                    الاسم        TSSTcorp CDDVDW SN-208BB
                    القرص        E:
                    معدل النقل        -1
                    الحالة        OK
    IDE تحكم        
                    الاسم        Standard SATA AHCI Controller
                    المنتج        Standard SATA AHCI Controller
                    الحالة        OK
    وصلة الفيديو        
                    الاسم        Intel(R) HD Graphics 3000
                    معالج فيديو        Intel(R) HD Graphics Family
                    المنتج        Intel Corporation
                    فيديو فن العمارة        VGA
                    DAC نوع        Internal
                    حجم الذاكرة        1.15 GB
                    نوع الذاكرة        Unknown
                    وضع الفيديو        1366 x 768 x 4294967296 colors
                    معدل التحديث الحالي        60 Hz
                    إصدار التعريف        9.17.10.3347
                    سجل الأحداث        29/01/2014
    جهاز العرض        
                    الاسم        Generic PnP Monitor
                    ارتفاع الشاشة        768
                    عرض الشاشة        1366
                    الحالة        OK
    Ethernet        
                    اسم المنتج        Realtek PCIe GBE Family Controller
                    اسم الخدمة        RTL8168
                    المنتج        Realtek
                    MAC عنوان        NULL
    Wi-Fi        
                    اسم المنتج        Intel(R) Centrino(R) Wireless-N 130
                    اسم الخدمة        NETwNs32
                    المنتج        Intel Corporation
                    MAC عنوان        DC:A9:71:7A:A9:3B
    Local Area Connection        
                    اسم المنتج        TAP-Windows Adapter V9
                    اسم الخدمة        tap0901
                    المنتج        TAP-Windows Provider V9
                    MAC عنوان        NULL
    أجهزة الصوت        
                    الاسم        صوت الشاشة من Intel(R)‎‎‎
                    المنتج        Intel(R) Corporation
                    الحالة        OK
    الفأرة        
                    الاسم        Samsung PS/2 Port Input Device
                    المنتج        ELAN
                    الأزرار        0
                    الحالة        OK
    لوحة المفاتيح        
                    الاسم        Standard PS/2 Keyboard
                    الوصف        Enhanced (101- or 102-key)
                    وظائف المفاتيح        12
                    الحالة        OK
    USB أداة تحكم        
                    اسم المنتج        Intel(R) 6 Series/C200 Series Chipset Family USB Enhanced Host Controller - 1C2D
                    المنتج        Intel
                    بروتوكول معتمد        Universal Serial Bus
                    الحالة        OK
    USB أداة تحكم        
                    اسم المنتج        Intel(R) 6 Series/C200 Series Chipset Family USB Enhanced Host Controller - 1C26
                    المنتج        Intel
                    بروتوكول معتمد        Universal Serial Bus
                    الحالة        OK

    http://apps.microsoft.com/windows/en-us/app/fifa-14/e89c9ccf-de94-45ed-9cd4-7e11d05c3da4
    System requirements
    OS: Windows 8
    CPU:  1.8G core2duo
    RAM: 1G
    GPU: NVidia card 7800 GT+ with 512M+ vram
    This game is not fully optimized to work with some ATI GPU cards.
    Keyboard support is not available.
    try to contact game manufactured, maybe your GPU doesn't meet requirement

  • Hi, i have an 6 gene ipod nano and having some trouble: suddenly the level of the sound starts getting lower and lower without my command...thanks.

    hi, i have an 6 gene ipod nano and having some trouble: suddenly the level of the sound starts getting lower and lower without my command...thanks.

    hi, i have an 6 gene ipod nano and having some trouble: suddenly the level of the sound starts getting lower and lower without my command...thanks.

  • When I select a photo on my iPhone and send it via email, the receipient receives it sideways. Any way to fix that?

    When I select a photo on my iPhone and send it via email, the receipient receives it sideways. Any way to fix that?

    When you took this photograph your phone was being held in that way. Sideways, try taking the photo straight on. Or it is the Picture file itself, open up the application you edit photos with and rotate it to be proper orientation. I recently had the same problem but you either have to retake or edit it at this point.

  • When I populate a form and send to my printer, the form prints without the info I entered

    When I populate a form and send to my printer, the form prints without the info I entered. How do I fix this?

    Posted last week:
    Epson Printer Drivers v2.19 for OS X
    If you use Software Update, probably got installed. If you are like me, you clone your system before any update or changes, in case something breaks.
    Windows you don't or haven't heard of? VM = virtual machine, ie a guest OS running under Mac OS (or running natively on its own partition, seeing sometimes there is software that is essential but only needed for business or once in a while). Runs just like another app (and uses an app to control the guest OS).

  • Certificate for the website, was going to copy and send an email to the website to ask about the certificate. I got my cursor just inside the pop up and the whole computer shut down. Why what happened i am not sure about going to the website now....

    Question
    Went to Crossings Book Club website while there something popped up about the certificate for the website, i was going to copy it and send an email to the website to ask about the certificate. I got my cursor just inside the pop up and the whole computer shut down.

    If you think getting your web pages to appear OK in all the major browsers is tricky then dealing with email clients is way worse. There are so many of them.
    If you want to bulk email yourself, there are apps for it and their templates will work in most cases...
    http://www.iwebformusicians.com/Website-Email-Marketing/EBlast.html
    This one will create the form, database and send out the emails...
    http://www.iwebformusicians.com/Website-Email-Marketing/MailShoot.html
    The alternative is to use a marketing service if your business can justify the cost. Their templates are tested in all the common email clients...
    http://www.iwebformusicians.com/Website-Email-Marketing/Email-Marketing-Service. html
    "I may receive some form of compensation, financial or otherwise, from my recommendation or link."

  • Cannot log in to Nationwide internet banking in Firefox. I get the front page but Login says internet banking is not working. Next screen says it's ok and sends you back to the first screen, which says it isn't. Works throughInternet explorer

    Question
    Cannot log in to Nationwide internet banking. I get the front page but Login says internet banking is not working. Next screen says it's ok and sends you back to the first screen, which says it isn't. Works throughInternet explorer

    That issue can be caused by corrupted cookies.
    *https://support.mozilla.org/kb/Cannot+log+in+to+websites
    Clear the cache and the cookies from sites that cause problems.
    "Clear the Cache":
    *Tools > Options > Advanced > Network > Offline Storage (Cache): "Clear Now"
    "Remove Cookies" from sites causing problems:
    *Tools > Options > Privacy > Cookies: "Show Cookies"

  • I created an iDVD through iMovie on one computer in my home and want to edit the slideshow and delete some videos on the iDVD.  However, I want to work on my own iMac.  Is there a way to "share" the original project through the drop box on my computer?

    I created an iDVD through iMovie on one computer in my home and want to edit the slideshow and delete some videos on the iDVD.  However, I want to work on my own iMac.  Is there a way to "share" the original project through the drop box on my computer?

    Sir Churchill, I tried deleting one of the playlists from my computer (Playlist 130).  The next day I checked my wife's computer and noticed that Playlist 130 was now missing from her computer as well.  Is there a way that I can delete a playlist from my computer without it disappearing from hers as well?

  • HT204053 Hi i was living in australia for a while and bought some stuff with the australian itunes. Now i'm back in the uk i cant re-download them. Can anyone help?

    Hi i was living in australia for a while and bought some stuff with the australian itunes. Now i'm back in the uk i cant re-download them. Can anyone help?

    Welcome to the Apple Community.
    Click on your account name in the top right corner of the iTunes store in the iTunes application on your computer, enter your password and click the "view account" button. Navigate to the Apple ID summary where you have the option to "change country or region".
    In order to change your location, you will need a credit card registered to an address in the location you are trying to change to.
    You cannot change your location if you have credit on your account, if you are unable to spend your credit and leave a balance of zero, contact Apple, which you can do through iTunes Store Support.

  • I have a MacBook 7,1 which i recently installed a PNY 250 SSD and added some RAM. The laptop was running awesome with OSX 10.6.8, lightning fast.  Then I installed Yosemite. There was a bit of hang during the install, but Yosemite came up no issue

    I have a MacBook 7,1 which i recently installed a PNY 250 SSD and added some RAM. The laptop was running awesome with OSX 10.6.8, lightning fast.
    Then I installed Yosemite. There was a bit of hang during the install, but Yosemite came up no issue when I rebooted. Here is the problem:
    Every other time I boot the MacBook it hangs at a grey screen with the prohibitory sign. Verbose reveals a "still waiting for root device" error. Now if I reboot from that hang, it boots fine, but then will hang again the next time. It keeps alternating like this. Any ideas??
    I am not running any third party trim software, so that's not the issue.

    I have a MacBook 7,1 which i recently installed a PNY 250 SSD and added some RAM. The laptop was running awesome with OSX 10.6.8, lightning fast.
    Then I installed Yosemite. There was a bit of hang during the install, but Yosemite came up no issue when I rebooted. Here is the problem:
    Every other time I boot the MacBook it hangs at a grey screen with the prohibitory sign. Verbose reveals a "still waiting for root device" error. Now if I reboot from that hang, it boots fine, but then will hang again the next time. It keeps alternating like this. Any ideas??
    I am not running any third party trim software, so that's not the issue.

  • Whenever I try to erace something with the delete button it acts like "tab" and sends me all over the page when all I want to do is erace what I wrote... help!

    Whenever I try to erace something with the delete button it acts like "tab" and sends me all over the page when all I want to do is erace what I wrote...How do I fix this?

    Whenever I try to erace something with the delete button it acts like "tab" and sends me all over the page when all I want to do is erace what I wrote...How do I fix this?

  • Freezes and restarts some times during the day

    In March 2014 I bought a nokia lumia white icon Verizon Microsoft Store in Orlando, I live in Brazil so I'm using the unit in a Brazilian company, so I do not own a Verizon number. He's presenting problem, freezes and restarts some times during the day, as did the recovery and all other procedures that read on the subject, the problem was not resolved. I would like to inform me how do I change the device since it will be going back to the U.S. next month per 10 days, he is still within the warranty period of 12 months.
    Thank you very much.

    hi mate, as we are a user to user forum only for Nokia products and services, we don't have that kind of information on hand. you will need to liaise with Verizon directly.
    however, have you checked that your nanoSIM card is cut correctly, and also that you are up to date with the latest firmware for the device, along with the latest Nokia system app updates from the Store? also try performing a soft reset.

  • When I tilt images and text, some people see the white outline around them.

    Here is my site
    http://web.mac.com/chawayos/portfolio/menu.html
    everything on this page is tilted by using the yellow ruler on inspector button
    It seems ok with me. But some people that use PC also see the white outline and a red cross around the spot that has been tilted like this (Wanna show you all but cant find how to post pics here)
    I guess that's because I tilt them and the white outline is like a guide to show 90 degree before tilted.
    Please open my site and let me know what you see.
    And if you know how to remove it, let me know pleaseeee
    Thanks,

    Turn off RTF as message format. Many outlook users disable the display of all messages in RTF/HTML format but allow to display plain text messages only (for security reasons). If you send out your mail as plain text, this Outlook user should get it displayed correctly.

  • Need To Create a table in Sql Server and do some culculation into the table from Oracle and Sql

    Hello All,
    I'm moving a data from Oracle to Sql Server with ETL (80 tables with data) and i want to track the number of records that i moving on the daily basis , so i need to create a table in SQL Server, wilth 4 columns , Table name, OracleRowsCount, SqlRowCount,
    and Diff(OracleRowsCount - SqlRowCount) that will tell me the each table how many rows i have in Oracle, how many rows i have in SQL after ETL load, and different between them, something like that:
    Table Name  OracleRowsCount   SqlRowCount  Diff
    Customer                150                 150            
    0
    Sales                      2000                1998          
    2
    Devisions                 5                       5             
    0
    (I can add alot of SQL Tasks and variables per each table but it not seems logicly to do that, i tryid to find a way to deal with that in vb but i didn't find)
    What the simplest way to do it ?
    Thank you
    Best Regards
    Daniel

    Hi Daniel,
    According to your description, what you want is an indicator to show whether all the rows are inserted to the destination table. To achieve your goal, you can add a Row Count Transformation following the OLE DB Destination, and redirect bad rows to the Row
    Count Transformation. This way, we can get the count of the bad rows without redirecting these rows. Since the row count value is stored in a variable, we can create another string type variable to retrieve the row count value from the variable used by the
    Row Count Transformation, and then use a Send Mail Task to send the row count value in an email message body. You can also insert the row count value to the SQL Server table through Execute SQL Task. Then, you can check whether bad rows were generated in the
    package by querying this table.  
    Regards,
    Mike Yin
    TechNet Community Support

Maybe you are looking for

  • Hi i wrote a java program for scanning a system for java.exe 's

    hi , i wrote a program which scans the system for java.exe 's and then it captures them in a linked list and then i iterate through it for "\\Java\\jdk1.5.0_08\\bin\\java.exe and my aim is to return true in case the linked list contains the string "\

  • The memory in my imac is going away i can no longer connect to the internet

    I have an old imac running 9.2. never knew how to use it, so only used it to connect to internet.never had a problem till last week. our pc has been a problem child , so my daughter took the time to figure out how to play her games on the imac. Then

  • Customer Receivable Aging report - customer Address

    Hi , when i am doing print preview by using the selection one customer per page and i have captured customer address also now i want the customer address to reflect on every page as same of customer. Thanks & Regards- Monica Karani

  • Disk Warrior and Quicktime 7.04

    I was having problems running Disk Warrior 3.03 (DW) from my cloned (using Super Duper) external firewire external hard drive (Lacie d2 HD 250GB). (NEW iMacG5 iSight) The problem: Boot from the clone and ran DW, at the completion of DW if I chose to

  • Mac Pro Bluetooth Magic mouse Solved

    I have spent this afternoon writing a blog all about this problem and how to fix it. http://nobblynoel.wordpress.com