Reading Registry entry from Java

Dear experts,
I need to read the registry entry's value "HKEY_CURRENT_USER\Control Panel\International\sShortDate"
from Java.
Will anybody help?
Thanks for future response
Unique

Do you really think it is a good idea to tie a program written in a language whose main
strong point is being platform-independent to a specific platform just to get a date format ?
You might want to take a look at http://java.sun.com/j2se/1.4.2/docs/api/java/text/DateFormat.html
regards
Holger

Similar Messages

  • Can't read registry entry AppPath... - My solution

    Good news! For me, there was a simple solution when I got this error message. (Some background: We just upgraded Office to 2007 and RoboHelp 8 from RoboHelp 5.) Today when I tried to open RoboHelp for Word (version 8) for the first time, I received this error message:
    "Can't read registry entry AppPath. RoboHelp may not be installed properly.
      Re-install RoboHelp if you continu to get this message."
    Actually, I didn't need to do anything major to successfully open RoboHelp for Word. The solution seemed to be simply to open RoboHelp for Word BEFORE opening Word. (Apparently, in my original attempt, I already had Word open.) So I rebooted my PC, and opened RoboHelp-for-Word first, and (Yeah!), RoboHelp for Word opened just fine.
    Perhaps this will help someone else.

    This forum is maintained by users of RoboHelp, not by Adobe, so your comments will not be seen by them.
    You say you are dissappointed with the Adobe RoboHelp team but you don't say if you have been to Support and what they suggested.
    I'm not sure what the problem is but I do know you cannot have more than one version of RoboHelp for Word installed on one PC. Maybe that is the cause.
    See www.grainge.org for RoboHelp and Authoring tips
    @petergrainge

  • Error while reading file entries from the database

    Hi there,
    We are running a instance of xmii 12 in a VM (VMware) and after somebody shutdown the host machine without shutting down the VM (great idea isn't it?) we keep getting this message when trying to access xMII:
    "Application cannot be started.
      Details:   com.sap.engine.services.deploy.container.ExceptionInfo: Error while reading file entries from the database."
    Any clue? Any suggestion on how we can recover from that?
    Thanks a whole lot,
    Dom
    Server log:
    #1.5 #000C29A3B1F20002000000C400000F2800044829A35270F8#1205243578005#/System/Server##com.sap.engine.services.dbpool.deploy.ContainerImpl####n/a##60152160ef7211dcb7a5000c29a3b1f2#SAPEngine_System_Thread[impl:5]_17##0#0#Info#1#com.sap.engine.services.dbpool.deploy.ContainerImpl#Plain###DataSources or DataSource aliases of 'sap.com/tcmonitoringsysteminfo' application started successfully.#
    #1.5 #000C29A3B1F20002000000C500000F2800044829A3527A6C#1205243578005#/System/Server##com.sap.engine.services.servlets_jsp.server.container.WebContainer####n/a##60152160ef7211dcb7a5000c29a3b1f2#SAPEngine_System_Thread[impl:5]_17##0#0#Info#1#com.sap.engine.services.servlets_jsp.server.container.WebContainer#Plain###application [] Start of application [sap.com/tcmonitoringsysteminfo] finished successfully on Web Container.#
    #1.5 #000C29A3B1F20002000000C600000F2800044829A3527DB5#1205243578005#/System/Server##com.sap.engine.services.deploy####n/a##60152160ef7211dcb7a5000c29a3b1f2#SAPEngine_System_Thread[impl:5]_17##0#0#Info#1#com.sap.engine.services.deploy#Plain###
    Operation startApp over application sap.com/tcmonitoringsysteminfo finished successfully on server 305221750#
    #1.5 #000C29A3B1F20002000000C700000F2800044829A3527E03#1205243578005#/System/Server##com.sap.engine.services.deploy####n/a##60152160ef7211dcb7a5000c29a3b1f2#SAPEngine_System_Thread[impl:5]_17##0#0#Info#1#com.sap.engine.services.deploy#Plain###
    Operation startApp on application sap.com/tcmonitoringsysteminfo finished on current cluster node for 221 ms.#
    #1.5 #000C29A3B1F20002000000C800000F2800044829A3528B49#1205243578005#/System/Server##com.sap.engine.services.deploy####n/a##60152160ef7211dcb7a5000c29a3b1f2#SAPEngine_System_Thread[impl:5]_17##0#0#Error#1#com.sap.engine.services.deploy#Plain###Error occurred while initially starting application sap.com/xappsxmiiear:Error while reading file entries from the database.#
    #1.5 #000C29A3B1F20002000000CA00000F2800044829A352922B#1205243578015#/System/Server##com.sap.engine.services.deploy####n/a##60152160ef7211dcb7a5000c29a3b1f2#SAPEngine_System_Thread[impl:5]_17##0#0#Info#1#com.sap.engine.services.deploy#Plain###The synchronization of applications with DB completed for 39304 ms.#
    #1.5 #000C29A3B1F200040000000200000F2800044829B290A4F8#1205243834341#/System/Server/SLDService##com.sap.sldserv.DataCollector####n/a##0da42150ef7311dcb908000c29a3b1f2#SAPEngine_System_Thread[impl:5]_7##0#0#Warning#1#com.sap.sldserv.DataCollector#Plain###Communication configuration is incomplete. No data transfer possible until corrected.#

    Well thanks for the hint. Actually, the DB was up but corrupted. I managed to solve the bug by re-deploying xMII (using the SDM tool) which kept all my data but redeployed both the config db of (x)mii and the class files.

  • How to create an ODBC entry from Java

    From Java application, how can I create an ODBC entry in Ms Windows client?

    I know of two ways you could do this. One is very dangerous, but I will describe it here. ODBC DSN's are created using a GUI application from within the Windows Control Panel. The GUI application manages a set of files found in the Windows directory. You can find them if you search for the ODBC. You should find odbc.ini and odbcinst.ini. These are text files, and you can view there structure using notepad. A Java program could open a stream and append whatever information you want to into these two files. The danger is that if you do it wrong, you will corrupt ODBC for all applications, so be very careful with this method.
    The 2nd method, as I described above has been discussed (to death) within this forum. Just spend a little time searching, and I know you will find what you need to implement using that method. This is the method I would recommend using.
    Good Luck,
    Joel

  • To read a DLL from java using JNI

    Hi,
    I had some DLL files (VB 5.0) which are providing interfaces. Is there any chance of accessing that using java (JNI). Also is there any De - Compiler available so that I can get the source code of the DLL file.
    Regards,
    Hari.

    Hola Hari
    To make a dll loadable through JNI, the interface
    inside
    the dll must be implemented the JNI way. Also a COM
    interface does not help.
    I would reccomend a certain product to automatise the
    JNI interfacing process, but that would
    require that you have the sourcecode of the dll
    available.
    But one thing you can do is to write a wrapper that
    contains the dll classes and is implemented the JNI
    way.
    More precisely you write an interface wrapper in c/c++
    that matches the methods of the dll and does use JNI
    methods. Now inside that c++ wrapper you load the dll
    and forward the calls from java to c++ vice versa.
    Download the demo version of CENTRO.java here:
    www.ablon.de
    Bye, nilsHi Nils,
    Thank you for your suggestion. Im new to JNI.
    That dll's are in Visual Basic. I don't have the source code of the dll file. I got the interfaces available in the dll file from a Visual Basic program which make use of the dll file(which we are talking about). As I know only the method signatures in the interfaces(dll file), I request you to kindly provide me some help to wrap it in C/C++ program.
    Thanks in advance.
    Regards,
    Hari.

  • Delte the complete registry entries from roaming profile

    Hi,
    how can i delete the complete registry settings from a roaming profile user?
    I've got a problem with the Adobe Reader plugin, wich isn't available in the IE for this specific user. Other users are able to open PDFs within the IE 9. I've already deleted the AppData folder and the Profile folder. That doesn't solve the problem.
    I would avoid to create a new userlogin for the user an copy all data into the new profile.
    May there are some registry settings left that I have to delete.
    Thanks for help
    Malte 

    Hi Malte,
    As you want to delete the entire roaming user profile path for user, you can perform following.
    Run > regedit.msc, follow below path:
    HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList
    Find the profileimagepath containing the user you wish to delete and
    delete the entire key. Log off as admin and logon back as the user you are trying to fix. This will help to resolve your issue.
    Meanwhile sharing link and snap for additional information.
    How to reset a Roaming Profile in Windows 7
    Hope it helps!
    Thanks.
     

  • How to get An Attachment from(reading outlook attachment from Java)

    I am developing a Java Email client. This Email client is working for "POP3" server. This is working fine for recieving all the emails other than Outlook express attachment. This is first time I am posting a topic even I had answered some topics. Now I am expecting your help for to solve this. Please help me if anybody faced the same problem.Please send me the Actuall code retreive Attachment from Inbox
    Please Send to me That code
    [email protected]

    I think this peice of information and code would help u
    Getting Attachments
    Getting attachments out of your messages is a little more involved then sending them, as MIME has no simple notion of attachments. The content of your message is a Multipart object when it has attachments. You then need to process each Part, to get the main content and the attachment(s). Parts marked with a disposition of Part.ATTACHMENT from part.getDisposition() are clearly attachments. However, attachments can also come across with no disposition (and a non-text MIME type) or a disposition of Part.INLINE. When the disposition is either Part.ATTACHMENT or Part.INLINE, you can save off the content for that message part. Just get the original filename with getFileName() and the input stream with getInputStream().
    Multipart mp = (Multipart)message.getContent();
    for (int i=0, n=multipart.getCount(); i<n; i++) {
    Part part = multipart.getBodyPart(i));
    String disposition = part.getDisposition();
    if ((disposition != null) &&
    ((disposition.equals(Part.ATTACHMENT) ||
    (disposition.equals(Part.INLINE))) {
    saveFile(part.getFileName(), part.getInputStream());
    The saveFile() method just creates a File from the filename, reads the bytes from the input stream, and writes them off to the file. In case the file already exists, a number is added to the end of the filename until one is found that doesn't exist.
    // from saveFile()
    File file = new File(filename);
    for (int i=0; file.exists(); i++) {
    file = new File(filename+i);
    The code above covers the simplest case where message parts are flagged appropriately. To cover all cases, handle when the disposition is null and get the MIME type of the part to handle accordingly.
    if (disposition == null) {
    // Check if plain
    MimeBodyPart mbp = (MimeBodyPart)part;
    if (mbp.isMimeType("text/plain")) {
    // Handle plain
    } else {
    // Special non-attachment cases here of
    // image/gif, text/html, ...
    regards
    shanu

  • Dangling registry entry from Flash 9 - flashutil9f.exe

    I installed Flash 10, which supposedly removed Flash 9.
    However, there is a persistent and unremovable key in the Windows
    Registry:
    HKEY_CLASSES_ROOT\CLSID\{D4304BCF-B8E9-4B35-BEA0-DC5B522670C2}
    has a LocalizedString with the value
    @C:\WINDOWS\system32\Macromed\Flash\FlashUtil9f.exe,-101.
    It will not let me delete it. How do I get rid of this dead
    end registry entry?

    Thanks for your reply!
    We installed flash 9 with the .msi package, uninstalled in add/remove, or when upgrading the v10.
    Yesterday I installed Adobe creative suite Premium 4 and got the same problem, that's why I came back and upped the post. In system restore, the restore point created during the installation was called "uninstallation of flash 9".
    Nothing in event viewer about explorer.
    Edit: If i reinstall flash 9, explorer comes back after a restart...

  • Change DNS entry from Java

    I am looking for ways to update DNS entries in our DNS server on the fly from a Java web app. For example: Users can select a domain and modify its ip on the Java web site, then the DNS record is updated automatically.
    Is this possible? Please help...

    812256 wrote:
    I am looking for ways to update DNS entries in our DNS server on the fly from a Java web app. For example: Users can select a domain and modify its ip on the Java web site, then the DNS record is updated automatically.
    Is this possible?This is what happens when 'bind' and 'dhcp' work together - dhcp submits updates to bind.
    You want to submit updates to 'bind' yourself - that should be possible but
    you will need to "open up" your dns server so 'bind' accepts these updates from the machines that are allowed to submit them
    and you will need to implement the appropriate protocol or find a library that does it.

  • Reading XML file from java web service

    Hi
    I am developing web service using Netbeans and the application server is glassfish.
    but I am facing a problem
    I have folder called "config" which will include the xml files. What I need to do setting path into that folder
    but it will read from another location when I am deploying it
    How to set our own path ?
    Error
    DPL5306:Servlet Web Service Endpoint [NewWebService] listening at address [http://kapila.epic.lk:8080/WebApplication2/NewWebServiceService]
    deployed with moduleid = WebApplication2
    java.io.FileNotFoundException: /root/MyWorks/glassfish-v2/domains/domain1/config/OSconfig/MConfig.xml (No such file or directory)
    at java.io.FileInputStream.open(Native Method)
    My "conifg" folder, i have put in to working directory but it will read from "/root/MyWorks/glassfish-v2/domains/domain1/config/OSconfig/MConfig.xm"
    below method is used for getting its contain value
    public String getMainCofig() {
                String v ="";
            try{
              DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory
                        .newInstance();
              DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();
              Document doc = docBuilder.parse(new File("OSconfig/MConfig.xml"));
              doc.getDocumentElement().normalize();
              NodeList listOfSPRMs = doc.getElementsByTagName("MainConfig");
              Node firstSPRMNode = listOfSPRMs.item(0);
              if (firstSPRMNode.getNodeType() == Node.ELEMENT_NODE) {
                   Element firstSPRAMElement = (Element) firstSPRMNode;
                   // Getting platform
                   NodeList server_port = firstSPRAMElement
                             .getElementsByTagName("RunningPlatform");
                   Element server_port_el = (Element) server_port.item(0);
                   NodeList server_port_List = server_port_el.getChildNodes();
                    v= ((Node) server_port_List.item(0))
                             .getNodeValue().trim();
            }catch (Exception e){
            e.printStackTrace();
                    return v;
    Regards
       

    I didn't quite get what the problem is but if the the desired file is in custom directory why don't you just use absolute path to reference it?
    Like: "/home/my/OSconfig/MConfig.xml"

  • Problem in reading net content from java on unix environment

    Friends,
    I was trying to write sample java program which can able to connect to web and read the content.
    But facing some proble. Kindly help me
    package com.validate.email;
    import java.net.*;
    import java.io.*;
    public class ReadWSDL {
      public static void main(String args[]){
           String nextLine;
           URL url = null;
           URLConnection urlConn = null;
           InputStreamReader  inStream = null;
           BufferedReader buff = null;
           try{
                System.setProperty("http.proxyHost","proxy.resources.company.com");
                System.setProperty("http.proxyPort", "80");
              // Create the URL obect that points
              // at the default file index.html
              url  = new URL("http://ws.cdyne.com/emailverify/Emailvernotestemail.asmx?wsdl" );
              urlConn = url.openConnection();
             inStream = new InputStreamReader(
                               urlConn.getInputStream());
               buff= new BufferedReader(inStream);
           // Read and print the lines from index.html
            while (true){
                nextLine =buff.readLine(); 
                if (nextLine !=null){
                    System.out.println(nextLine);
                else{
                   break;
         } catch(MalformedURLException e){
           System.out.println("Please check the URL:" +
                                               e.toString() );
         } catch(IOException  e1){
          System.out.println("Can't read  from the Internet: "+
                                              e1.toString() );
    Error
    Can't read from the Internet: java.net.UnknownHostException: www.tpisoft.com

    my_forum wrote:
    The same code is working in Windows, where I get the proxy from Browser.How?
    But on Unix machine it is not working. And I am using the proxy which is DNS/hostname of the unix machine.Don't you mean the DNS/hostname of the proxy?

  • Unable to read Properties file from Java code

    Hi,
    The directory structure of my application is as follows:-
    My App
    ++++++ src
    ++++++++com
    ++++++++++readProp.java
    ++++++++resource
    ++++++++++message.properties
    I am trying to read the file as follows:-
    <code>
    public Static final string FilePath="resource.message.properties"
    Here the code to read the file. I tried using the following two techniques but to no use... :(
    File accountPropertiesFile = new File(FacesContext.getCurrentInstance()
    .getExternalContext().getRequestContextPath()
    + FilePath);
    properties.load(externalContext.getResourceAsStream(FilePath));
    </code>
    But none yeild any sucess while reading through the Bean class. please help...

    Your source code isn't there at run time, at least it shouldn't be, so the directory structure you've shown is irrelevant.
    If the file is in the corresponding position under WEB-INF/classes at runtime, the second technique should work, but you need to fix FilePath to agree with what it says under Class.getResource() and friends.

  • How to read XML files from java

    i need a sugession that how to read a xml file using java code
    and i need to parse using some parsers and display attributes and entity seperately
    as a string.......

    import org.dom4j.Document;
    import org.dom4j.DocumentException;
    import org.dom4j.io.SAXReader;
    import java.io.File;
    import java.text.AttributedCharacterIterator.Attribute;
    import java.util.Iterator;
    import java.util.StringTokenizer;
    public class XmlParser
    private String Result="";
    private String Final="";
    private String Delim="";
    public void bar1(Document document) throws DocumentException
    org.dom4j.Element root = document.getRootElement();
    // System.out.println(root.getName());
    bar2(root);
    System.out.println(this.Result);
    process();
    public void bar2(org.dom4j.Element e)
    for(Iterator i = e.elementIterator();i.hasNext();)
    org.dom4j.Element Element = (org.dom4j.Element) i.next();
    Result += Element.getName()+"\t"+Element.getText()+"\n";
    bar2(Element);
    public void process()
    StringTokenizer Tokenizer = new StringTokenizer(this.Result,"\n");
    String element;
    while(Tokenizer.hasMoreTokens())
    element = Tokenizer.nextToken();
    StringTokenizer Tokenizer2 = new StringTokenizer(element,"\t");
    // Do what ever String Process here Example
    this.Final += element.getName();
    this.Final += this.Delim;
    System.out.println(this.Final);
    public static void main(String s[])throws Exception
    Document document = null;
    SAXReader reader = new SAXReader();
    File f1= new File("D:/Rajesh/EDI to XML/EDI.xml");
    document = reader.read(f1);
    Demo obj = new Demo();
    obj.bar1(document);
    i think this will hep full.......

  • Webutil reading registry entries.

    I have the following program unit that works in forms 6i using the win_api_environment.read_registry program unit.
    l_filetype := WIN_API_ENVIRONMENT.Read_Registry
    ('HKEY_CLASSES_ROOT\'||l_extension, null, TRUE);
    -- Get associated OPEN command e.g.
    -- 'c:\win32app\msoffice\winword\winword.exe "%1"'
    l_command := WIN_API_ENVIRONMENT.Read_Registry
    ( 'HKEY_CLASSES_ROOT\' || l_filetype
    ||'\shell\open\command'
    , null, TRUE);
    However, when I converted this to work with webutil by adding client_ to the win_api_environment, I get a no_data_found error.
    In 6i, this returns the (default) value in the registry, if I change the null in both commands to '(default)', I still get no_data_found. If I insert a string value in the key I am looking at, it will return that key.
    Basically, my question is how do I get the (default) value returned?
    Thanks
    Stephen

    From my understanding of the source code of Client_win_api_environment.read_registry you need to explicitly pass the RegEntry as the second parameter to that function.
    l_command := client_WIN_API_ENVIRONMENT.Read_Registry ( 'HKEY_CLASSES_ROOT\',l_filetype ||'\shell\open\command', TRUE);
    (Because of the following line in Client_win_api_environment.read_registry, see webutil.pll:
    vcRoot := upper(substr(RegPath,1,instr(RegPath,'\')-1));
    RegPath is trimmed to the first appearance of '\')
    Hope this helps
    Gerald Krieger

  • Reading an entry form a txt file in unix from Forms50

    Hello all,
    In the windows version D2k there is a pll in the
    demo.d2kwutil.pll, this pll can be used to read/writ from/to ini
    files
    and registry strings.
    Can anybody tell me if there is a similar feature in the UNIX
    version to read/write entries from/to a text file. Also Is there
    a package for working with environment settings.
    Thanks,
    Sunder
    null

    It you want to read/write to the client side use text_io.
    If you wnat to read/write to the server side use utl_file.
    Petr Valouch (guest) wrote:
    : Sunder (guest) wrote:
    : : Hello all,
    : : In the windows version D2k there is a pll in the
    : : demo.d2kwutil.pll, this pll can be used to read/writ from/to
    : ini
    : : files
    : : and registry strings.
    : : Can anybody tell me if there is a similar feature in the UNIX
    : : version to read/write entries from/to a text file. Also Is
    : there
    : : a package for working with environment settings.
    : : Thanks,
    : : Sunder
    : Hi,
    : In all system you can use TEXT_IO build-in package to
    : read/write form/to text files.
    : Petr Valouch
    null

Maybe you are looking for