Searching through directory looking for browser

Hello all,
I was wondering if there is any way to search for the location of a file in your Java application and then launch the .exe file that is at that location.
(example: look for where Iexplore.exe is located on the current machine and then open up Internet Explorer using the the Runtime and Process classes.)
The way I have it now is a hardcoded path to Iexplore.exe. If it is not at that location, it will fail and I will display message "File not found at that location."
Thanks for all your help ahead of time,
jmschrei

You can launch explorer/navigator by
Runtime.getRuntime().exec("start http://www.web.com");
About searching a file:
public void searchFile(String dirName, String file)
throws IOException {
File directory = new File(dirName);
String path;
if (directory.exists() == true) {
path = directory.getPath();
if (directory.isDirectory() == true) {
File [] fileList = directory.listFiles();
for (int i = 0; i < fileList.length; i++) {
path = fileList.getPath();
if (fileList[i].isDirectory())
searchFile (path, file);
else if (fileList[i].isFile()) {
if(fileList[i].getName().equals(file))
Runtime.getRuntime().exec(fileList[i].getPath());
else {
if(fileList[i].getName().equals(file))
Runtime.getRuntime().exec(fileList[i].getPath());
This method should be called like:
searchFile("C:\", "iexplore.exe");
I hope it helps you.

Similar Messages

  • Is there a way to search through pdf looking for a few words "in close proximity" to each other?

    I started this question in an Adobe Reader forum, but am reposting here.
    Within one pdf, I'm trying to find the locations where two words appear close to each other. The document is a manual of Structured Framemaker from Adobe. The words are "context" and "element" (I'm trying to find out what "context" means in EDD in Framemaker).
    Using Advanced Search on Acrobat XI Professional, but the response is the same in Acrobat XI Reader, i.e. zero results.
    Putting a comma between words doesn't change results.
    Selecting either of these doesn't change results:
    --Match Any of the words
    --Match Exact word or phrase
    Clicking on the Show More Options adds a Proximity box but I've been unable to make the box selectable (it's greyed out).
    Although I'm only interested in the results of the one pdf, I was advised to select a whole folder. When I select a directory, additional options appear, but the Proximity button is still unselectable.
    What turns ON the Proximity button?
    Is there a way to change Acrobat default so that the More Options is always turned on?
    Thanks in advance.

    Proximity will become available if you're using a index (Tools > Document Processing > Full Text Index with Catalog), which you can create with Acrobat Pro for just this single document if you place it in a folder by itself. You will also have to select "match all words" or whatever the exact wording is in the advanced seach panel.

  • Audit directory and searching through the logs for deleted file

    Windows Server 2003
    I have found article http://whatevernetworks.com/?p=108
    And in description of this article is: to found deleted files in auditing directory I have to found event 560.
    But I have about 60 000 events.
    My file abcd.txt is missing and I have to find who delete it, but I cant click 60 000 times to find it.
    Moreover most of that event looks like its objcect open not object deleted.
    How to find this particular?
    Event Type:    Success Audit
    Event Source:    Security
    Event Category:    Object Access
    Event ID:    560
    Date:        2/23/2014
    Time:        11:48:00 PM
    User:        DOMAIN\user
    Computer:    PLWAW1FS00003
    Description:
    Object Open:
         Object Server:    Security
         Object Type:    File
         Object Name:    E:\Temp\download.domain.com\example.zip
         Handle ID:    1788
         Operation ID:    {0,477992664}
         Process ID:    1692
         Image File Name:    C:\WINDOWS\system32\xcopy.exe
         Primary User Name:    user
         Primary Domain:    DOMAIN
         Primary Logon ID:    (0x0,0x1C7D2FA0)
         Client User Name:    -
         Client Domain:    -
         Client Logon ID:    -
         Accesses:    DELETE
                READ_CONTROL
                WRITE_DAC
                WRITE_OWNER
                SYNCHRONIZE
                ACCESS_SYS_SEC
                ReadData (or ListDirectory)
                WriteData (or AddFile)
                AppendData (or AddSubdirectory or CreatePipeInstance)
                ReadEA
                WriteEA
                ReadAttributes
                WriteAttributes
         Privileges:    SeBackupPrivilege
                SeRestorePrivilege
         Restricted Sid Count:    0
         Access Mask:    0x11F019F
    Find fields are: Information/Warning/Error/Succes/Failure
    Event source: DS/IIS/LSA etc...
    Event ID:
    User:
    Computer:
    Description:
    and no filename, or action.
    Maybe I can use powershell to search through the logs?

    Hi,
    You can use Custom View and XML filter to filter specific event logs. Firstly, create a custom view. Then type an XML query to filter by ObjectName (abcd.txt).
    For more detailed information, please refer to the article below:
    Advanced XML filtering in the Windows Event Viewer
    http://blogs.technet.com/b/askds/archive/2011/09/26/advanced-xml-filtering-in-the-windows-event-viewer.aspx
    Regards,
    Mandy
    We
    are trying to better understand customer views on social support experience, so your participation in this
    interview project would be greatly appreciated if you have time.
    Thanks for helping make community forums a great place.

  • Search a Directory Tree For a Directory

    Hello All,
    Alright, the backround first. I am working on a system for managing photos for cases. So, the top photos dir has 5 dirs represnting the years. In each of those, are months, in those are days, and in the days there are dir named for the casenumber. This may sound confussing but...Say for Case number 05-00001 which happened January 1st 2005, the photos would be in ./photos/2005/1/1/05-00001/Now I cant change the dir structure because this is how the system uploads them, but I need a program to search this dir tree when the person enters a case number and return the photos. Everything works great (from a logic standpoint) but the problem is that there are about 20,000+ cases a year and if the case is toward the end it takes FOREVER to search through them all.
    What I am looking for is suggestions on how to most efficently search for these cases...
    Thanks,
    Matt

    a particular string. I was able to read one file in
    a single directory but not in any other directory.
    How would I go about writing code to be able to
    access all files in directory that has multiple sub
    folders.
    You can do that several ways.
    Most likely you'll end up with some sort of recursive iteration over the directory tree.
    Not hard to write, somewhat harder to prevent memory problems if you end up with a lot of data.
    Also, when I started to write my program I tried to
    use the DOM XML Parser to parse my html page. My
    logic behind this decision was that if you look at
    html code it is an xml document. But as I was
    trying to run my program I noticed that I had to
    convert my html document into xml format. I really
    don't want to have to build my own html parser. Is
    there a html parser that is included in Java. Oh my
    program is just your basic text program. No
    interfaces.
    A VALID xhtml document is a valid XML document.
    Problem is that most HTML isn't xhtml.
    Another problem is that most HTML is fundamentally broken even to its own standards (which have always been based on SGML on which XML is also based).
    Browsers take that into account by being extremely lax on standards compliance and effectively making up tags as they go along to fill in the missing ones in the trees they parse.
    That's however not a standardised process and each browser handles it differently (and as a result most html will render differently in different browsers).
    Java contains a simple HTML parser in Swing, but it's primitive and will only parse a subset of HTML 2.0.
    There are almost certainly 3rd party libraries out there that can do better, both free and/or commercial.

  • My ipad stays in searching mode when looking for software update and doesn't give results

    When I try to look for updates it is just searching and I even left it fir hole day and remained in search mode.

    Had the same problem. Called Apple support. They claimed it could be a network problem since I did the download over wifi. They told me to try again using Itunes. When that didn't work, they said it was a corrupted itunes and I reinstalled it. During the reinstall, I tried it on another computer and it still did not work. After reinstalling itunes, I still got the corrupt message. Apple told me to go to my local Apple store and try their network. I was told that would do the trick. Guess what? It did not restore on the Apple network and the "Genius" tech person said that this error was similar to the windows "blue screen of death" and they could not repair it. Since the Ipad 2 was out of warranty, they offered me a replacement for $249 (no thanks) and said it was just one of those things. If anybody finds a fix, please let me know. I guess the lesson learned is NEVER download a new update the first day.

  • Looking for browser-based, end user  ad-hoc reports

    Hi all. We have need for an easy to use, browser based end-user reporting tool that can be hosted by CF10. We are spending a fantastic amount of time building custom tabular reports for our client and would prefer to give them a tool in our app that let's them build reports whenever they want. Do any of you know of any good reporting tools where the end-user could build their own reports?
    Thanks for your help.
    -Andy

    Hi Andy,
    You could try JReport.  Its a reporting and data visualization tool that let's anyone of any skill level create and modify their own reports and dashboards.  You can even embed them into other applications.  Let me know if you want to chat about it.
    JReport website: www.jinfonet.com
    -Dean
    dyao (at) jinfonet.com

  • Help w/ search - I'm looking for Rob Thomas!

    I wanted to buy the song "Smooth" by Santana feat. Rob Thomas.
    In the "Search music store" editable area of iTunes, I entered "Smooth" (and yes! I checked the spelling several times). A lot of songs pop up into my list, including "Smooth" by Glenn Alves, "Smooth" by S.A.G.E etc. but no Santana or Rob Thomas.
    I then entered Santana in the "Search music store" box, found the album Supernatural, which includes the song "Smooth". This song is no different from the others, I can buy it alone from the album.
    I took "Smooth" as an example, but this already happened with other songs... Any explanation? Should I report this as a bug?

    Unfortunately I doubt it's a bug. It's just a way of making you pay for the whole album, by making that song, which is good and most users will probably want, album only. I see it happen to a lot of good songs now

  • Looking for Javascript to replace 'selected' pages in a pdf?

    Hi
    I've searched the web looking for a solution to a time consuming issue without luck. I have multi-page, print ready pdfs - but have to make corrections to a number of 'random' pages in InDesign. I have to replace only the random corrected pages in the standing pdf.
    An ideal solution would be a script that could launch an interface allowing input of the corrected page numbers eg: 3,5,14,56,92,146, together with a facility to select the corrected file/or files to replace pages, page number for page number in the print ready pdf. Does anyone know of a solution or possible starting point?
    MTIA

    Hi,
    Have you tried transforming this using XSLT?
    Regards
    Ayyapparaj

  • Looking for a name with special character

    Hi Gurus,
    In our HR system we use multiple language (eg: polish, french, german, english, finns, ...).  All those languages have some specific characters, like german with ß.
    When we use the search help to looking for someone, it seems that only people who have the special character on their keyboard can find directly the correct name.
    For example :
    If I use a german keyboard I can found an employe by completed the correct last name wich contain eg ß .
    if I don t use a german keyboard I have to put a * where the specific characters is.
    I would like to know if somehow it were possible to customize the system in order to do not need to enter a * but the correspondant singular letter.  Is there any function for converting a special character to a singular one to activated ?
    Thank you for all your help
    Best regards
    Hadrien

    indexOf() is used to find where a character or substring appears in a
    given string. What you probably need is charAt() which finds out which
    character is at a given position. Like this:private JTextField reportNameText;
    // something needs to be put in the text field here
    String reportName = reportNameText.getText();
    if(reportName.charAt(0) == ' ') {
            // printing a space isn't a lot of good...
        //System.out.println("first character is"+reportName.indexOf(0));
        System.out.println("first character is a space");
        JOptionPane.showMessageDialog(null,"Report Name should not start with Space", "", JOptionPane.PLAIN_MESSAGE);
    }An even better condition might beif(Character.isWhitespace(reportName.charAt(0))) {This checks for other sorts of space.
    The String methods are described here:
    http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html

  • Looking for WEB HOST that I can do servlets and applets on

    Hello everyone,
    Does anyone know where I can buy web space that will allow me to run a servlet and applet from. I have been shopping today and I had difficutly finding one.

    Hmm.... well duffymo. I have gone to a number of sites through Google looking for web hosting sites that support java and I must be picking all the wrong ones to look at because I have only found one in Fremont out of 25-30 that I have looked at.
    I guess duffymo you can say what you want in a forum, but usually answering a question with a question isn't very helpful nor appreciated.

  • Looking for a free iOS 4 app that can search through .pdf files or spreadsheets

    Looking for a free iOS 4 app that can search through .pdf files or spreadsheet    
    Thanks

    Hey there
    "pdf creator" for iPad works flawlessly for me working with pdf files
    It takes care of all my needs
    I'm not sure about sending via Wifi or Bluetooth but I send them via e- mail all the time
    Possibly it could handle your needs as well
    Just type it into the App Store search field and the first one that comes up is the one I use
    Jump on over there and read up on it before buying and see if it will help you 
    Hope this helps
    Regards

  • Graphics Interface for browsing through local directory structure

    Hi ... Friends,
    Is there a way in Forms 4.5 under Windows 95 for providing a graphical interface to the user for browsing through his local disk and associated files and directories?
    Something like the window we get when we File -> Open in any windows application, which allows the user to open a file ...

    Hi, Abhijit
    The function win_api_dialog.open_file might be what you're looking for.
    It's included in the d2kwutil.pll, which is part of Forms Demos.
    Hope this helps,
    Pedro

  • How do I remove a DNS Solution Error?  Sometimes when I do a search using a Firefox browser, this message comes up and it doesn't take me to the site I am looking for.

    Sometimes I use Firefox for browsing and when I do a search,  the search engine will not take me to the site but I get a message that says "DNS Solution Error".
    I believe it is some kind of malware.  I appreciate any help from anyone who knows how to fix it.

    You may have installed a malicious or defective Firefox extension. Remove all extensions that you don't know you need. If in doubt, remove all of them. Otherwise, check the Firefox network settings (not the Network pane in System Preferences) for a proxy server.

  • Unable to load Facebook on MBP in any browser - looking for more information

    I have searched the Internet far and wide trying to figure out what is wrong, but every suggestion I have tried has failed.  So here is my question:
    Last night, I turned on my MBP and tried to log onto Facebook.  I use Google Chrome as my default browser.  Chrome was unable to connect to www.facebook.com.  I tried in Safari also with no luck.  Facebook seems to be the only web site I cannot connect to.  Over the same wifi connection, I was able to connect to Facebook from my home PC, my iPad, and my iPhone (the actual web site and thru the app).
    This morning, I brought my MBP to work to try again.  Same problem.  I cannot access Facebook from my MBP, but I can from my work PC and my other iOS devices.  I even tried turning Personal Hotspot on my iPad and connected my MBP to that.  Still no luck.
    Based on everything I've read online, I've done many things to try to resolve this.  I've cleared my cache and cookies, I've rebooted my MBP several times, I've flushed my DNS.  I've even tried using Open DNS.  I even tried some of the more ridiculous sounding ideas, like changing the date on my MBP.  I am currently running Sophos in hopes that maybe the reason this is happening is because of some malware or trojan or something.  The only thing I HAVEN'T done yet is completely reinstalled Mountain Lion.  Honestly, I would rather avoid having to try this approach, as it seems that is a slightly extreme approach to fixing what should be a relatively straightforward problem to diagnose.
    I've been racking my brain, trying to think of any updates I could have done in the last day or two that might have caused this very specific problem.  According to System Information, the last set of updates I probably made right before this problem manifested were for Microsoft Office.  I'm showing "Office 2011 14.2.5 Update", "Microsoft Error Reporting for Mac", and the very cryptic sounding "Plugin" as all having been installed yesterday.  Based on the times each was installed, "Plugin" was not installed with the Office updates, so I'm wondering if maybe that is the culprit.  Unfortunately, I have no more information than that.
    I guess what I'm looking for are ideas on how I can better diagnose what is going on.  I've tried the solutions people have posted online to no avail. If I knew what was happening behind the scenes, that might help me figure out what I really need to do to get this working again, before I'm forced to resort to a reinstall of Mountain Lion that may or may not even resolve this issue.  If anyone has better ideas on what could be wrong or ways in which I can get more information to better diagnose this problem, please post them here.  Thank you!

    I didn't think reinstalling was gonna do me any good except for getting rid of every single thing I have ever installed since getting this MBP.  I'm thinking it has to be something that is on my computer causing this, especially since it only affects my ability to get to this one site and I only started seeing this problem yesterday.
    So, I went ahead and disabled all my Chrome extensions and I don't have any Safari extensions at all.  That didn't fix my issue.
    I've been trying to run Sophos on here, thinking that maybe I've got a Trojan or some kind of malware, but it never seems to finish a full scan of my hard drive.  That "Plugin" that I mentioned above has me very suspicious, except that whatever that is, it's been on my computer since basically when I first got it.  Maybe it's malicious, or maybe it's just a poorly named piece of software.  In any case, it got updated last night around 11pm, about the same time I noticed my problem.  After trying everything I have, it's hard for me to overlook that as coincidence.
    But, where do I go to gain more information about what that could be?  I should mention that this MBP is basically my first Apple computer.  I've been a PC guy (still am mostly) forever, but I finally dove in and got a Mac to start iOS development.  So I'm sure there are ways to get more information than I am currently aware of.
    Also, apologies if I posted this in the wrong forum.

  • Looking for a name of the application that allows you to browse files

    Looking for a name of the application that allows you to browse files in Linux shell! Here's someones screenshot
    http://s8.postimg.org/ksexr9nbp/image.jpg
    that app in the middle - browsing home directory!
    Thanks all in advance!

    bohoomil wrote:Check the Wiki, File managers, and generally always check the Wiki before asking, after asking, and instead of asking...
    An apple can be an effective contraceptive. Not before. Not after. Instead.

Maybe you are looking for