Retreiving system directories in java

I am want to get the system directories e.g. c:\WINNT etc. How do i retreive it. Otherwise how can I check if the given directory is a system directory?

Very easy.
String osName = System.getProperty("os.name");
if (osName.indexOf("Windows")!=-1)
if (osName.indexOf("95")!=-1 || osName.indexOf("98")!=-1/* || osName.indexOf("Me")!=-1*/)
cmdLine = "command.com /c echo %windir%";
else //if (osName.indexOf("NT")!=-1 || osName.indexOf("2000")!=-1 || osName.indexOf("XP")!=-1)
cmdLine = "cmd.exe /c set windir";
else throw new Exception("Unsupported OS type (Only Windows 32bit)");
Process proc = Runtime.getRuntime().exec(cmdLine);
InputStreamReader reader = new InputStreamReader(proc.getInputStream());
// read input...

Similar Messages

  • How to cooperate the current mail system with Sun Java Commnication Suite 5

    Dear all and Shane,
    Excuse me for bothering you again.
    Due to time limited, I would like to know how to cooperate the current mail system with Sun Java Commnication Suite 5. I mean I would like to use current mail system (mailscanner + postfix + courier-IMAP + clamav + spamassassin + webmail) and use the outlook connector to connect to Sun Java COMMS 5 to share the calendar, contacts only.
    Right now I have done the testing by using outlook, mac mail, thunderbird to share calendar,contacts via Sun Java COMMS 5 in Centos Linux 5.
    My plan is as following
    1. Sun Java Communication suites 5 server ( I called it comms5 ) will be in DMZ zone and will open the necessary ports in firewall.
    2. I will create more than six sub domain name in Sun Delegate server and the necessary accounts within these domain names.
    3. All messages will be transmitted via Postfix and clients will retrieve from Courier-IMAP
    4. All Clients included other branch offices will use different mail clients to share their calendars, contacts via COMMS5 ( But how will COMMS handle the messages such like invitation ? )
    Any suggestions will appreciate.
    PS: Is it possible to classify the contacts in outlook address book ?
    For example, when user click the receiver, it will show like as following
    GLOBAL ADDRESS BOOK
    --Director
    --and so on
    ----CN.BRANCH OFFICE
    -----------CN01 EMAIL ADDRESS
    -----------CN02 EMAIL ADDRESS
    -----------CN03 EMAIL ADDRESS
    and so on
    ----JP.BRANCH OFFICE
    -----------JP01 EMAIL ADDRESS
    -----------JP02 EMAIL ADDRESS
    -----------JP03 EMAIL ADDRESS
    and so on
    ----TW.BRANCH OFFICE
    and Due to the user account is located in CN.BRANCH OFFICE, it will extend the CN.BRANCH OFFICE contacts level.
    Excuse me for bad English, hope you can understand it.
    Best Regards,
    Bruce

    Dogz wrote:
    Due to time limited, I would like to know how to cooperate the current mail system with Sun Java Commnication Suite 5.
    I mean I would like to use current mail system (mailscanner + postfix + courier-IMAP + clamav + spamassassin + webmail) and use the outlook connector to connect to Sun Java COMMS 5 to share the calendar, contacts only.Getting your current mail system to 'co-operate' in this way will require more time then simply migrating the accounts of users on the current mail system to the comm-suite-5 installation and making use of UWC for Webmail access and ClamAV/SpamAssassin integration within the messaging MTA.
    Also the use of Outlook Connector with a non-Sun IMAP backend isn't supported, nor is the use of a non-Sun IMAP backend possible with UWC.
    Right now I have done the testing by using outlook, mac mail, thunderbird to share calendar,contacts via Sun Java COMMS 5 in Centos Linux 5. Once again I should remind you that CentOS is not a supported platform for comm-suite-5
    Regards,
    Shane.

  • How to change system time through java program

    Hi
    I want to know, how to change system time through java program.
    give me a idia with example.
    Thanks

    There isn't any core Java API for this. Use JNI or call an external process with Runtime.exec().
    ~

  • IBM Systems Director link to HMC does not open

    I use IBM Systems Director. When I find a VM on Systems Director and click on the link for the VM, a new window should open to another application called Hardware Management Console. The window does not open, I only see the screen blink once. Pop up blocker disable does not help.
    This used to work on older versions of firefox and it currently works on IE 9.
    I do not receive any error messages.
    Thanks

    Hi mikosrt, these releases were current in March 2013:
    * General releases
    ** 19.0 before March 7th
    ** 19.0.1 released March 7th
    ** 19.0.2 released March 8th
    * Enterprise releases
    ** 17.0.3esr before March 7th
    ** 17.0.4esr from March 7th forward
    A lot has changed since Firefox 19, so it may be difficult to pin down the issue. If you need to run this application in Firefox 19, you could use the unofficial "portable" release. This installs to a single folder independent of your main Firefox. However, you generally can't run both at the same time.
    You can download portable releases from SourceForge for testing to find the latest one that works:
    Firefox 19.0.2: http://sourceforge.net/projects/portableapps/files/Mozilla%20Firefox%2C%20Portable%20Ed./Mozilla%20Firefox%2C%20Portable%20Edition%2019.0.2/
    Firefox 20.0.1: http://sourceforge.net/projects/portableapps/files/Mozilla%20Firefox%2C%20Portable%20Ed./Mozilla%20Firefox%2C%20Portable%20Edition%2020.0.1/
    Firefox 21.0: http://sourceforge.net/projects/portableapps/files/Mozilla%20Firefox%2C%20Portable%20Ed./Mozilla%20Firefox%2C%20Portable%20Edition%2021.0/
    Firefox 22.0: http://sourceforge.net/projects/portableapps/files/Mozilla%20Firefox%2C%20Portable%20Ed./Mozilla%20Firefox%2C%20Portable%20Edition%2022.0/
    Firefox 23.0.1: http://sourceforge.net/projects/portableapps/files/Mozilla%20Firefox%2C%20Portable%20Ed./Mozilla%20Firefox%2C%20Portable%20Edition%2023.0.1/

  • Calling the system commands in Java

    Hi All,
    How to call the system commands in java other than using
    exec() function.For eg, in my linux machine i have used p.exec("exit") to exit from a cshell to the prompt but it is not working.Is there any other solution for this one. Pls. do provide a solution for this.It is quite Urgent.
    Thanks,
    m.ananthu

    Why not SEARCH THE F*ING FORUMS!! This has been answered SO MANY TIMES

  • System time for Java Stack and ABAP Stack of PI

    HI,
         We have a scenario in which we have a synchronous flow of data. In the forward flow we have used field UZEIT in an RFC Lookup to register the inbound time and in the reverse flow we have used current time function of SAP PI mapping. PI time is the local time of the server, However UZEIT is 4 hours ahead compared to PI time.
    Both the Java and the Abap stack are installed on the same server.
    Kindly let us know the reason for the difference in time on both the stacks.
    Regards,
                Milan Thaker

    Hi,
       Yes I am refering to the System->Status time in ABAP Stack. Could you please tell me where can I check the System time of JAVA stack. I got one XML file in UME which refers to some timestamp in com.sap.security.core.usermanagement but I failed to locate this field. Please let me know where can I find the Java stack time and how can that be synchronized with ABAP.
             Also, is there any time zone settting in JAVA for UTC , the way we have in ABAP
    Regards,
                  Milan Thaker

  • I have recently started a solaris. I have a solaris using 64x and 86x systems and have java. The machine is very active and is very quick. I am happy so far with its performance and think its worthwhile to continue with my projects. That's all I have to s

    I have recently started a solaris. I have a solaris using 64x and 86x systems and have java. The machine is very active and is very quick. I am happy so far with its performance and think its worthwhile to continue with my projects. That's all I have to say.
    John Lupton

    I have recently started a solaris. I have a solaris using 64x and 86x systems and have java. The machine is very active and is very quick. I am happy so far with its performance and think its worthwhile to continue with my projects. That's all I have to say.
    John Lupton

  • Only one business system for outbound java proxies?

    Hi!
    I have a problem regarding java proxy runtime JPR.
    When I call the deployed outbound proxy from a client program, the java proxy sender service is always one defined business system. even if that has nothing to do with the business systems used by the proxy.
    For example: I define a business system on the Web AS, which is responsible for the java proxy communication, this is the bean defacto. When I call this bean from a client the JPR calls the Integration Server using another business systems channel. Of course I get the runtime exception service unavailable, because it is not used in interface determination, as the sending channel. If I use the 'working' business systems channel it works just fine
    I hope you get my problem.
    If I enter the Adapter Monitor, then choose the JPR I can see under Cache that the working business system has several entries here.
    Where is the difference between the one working system and others, has anybody ever faced this problem?
    regards
    Stefan

    When you call an outbound java proxy bean, the sender business system is usually derived from the business system which is connected to the technical system Web AS Java in SLD.
    If you want another sender business system, then you can set this with the application program with help of the message specifier class (look at manual for further details).
    I recommend writing a wrapper bean around the generated proxy bean classes to enable the sending application program to provide the business system as a parameter. In that way different senders can provide their business system separately.
    Regards
    Stefan

  • Developing 3rd party UWL Connectors for People soft system or other Java sy

    Hi Everyone
    We have one requirement that is u201CDeveloping 3rd party UWL Connectors for People soft system or other Java systemu201D and get the workflows from those system and display in portal though UWL.
    We used u201CUWL Custom Connector APIu201D and written all the required methods.
    Could any one help us u201CWhere can we specify the 3rd party system details?u201D
    If possible please send some sample coding for it.
    Thanks in advance
    Sat

    Hi Satya!
    Like the default SAP backend UWL connectory your 3rd-party connector should make use of a PCD System Object. This system is a mere java component with nothing more than a portalapp.xml defining all the system properties.
    Create a system in the portal system landscape based on the System PAR you depoyed.
    For every UWL connector you create in portal you define a system alias. This alias has to match the one of your new system object.
    And now for the sad part: I didn't find any clue yet about how to access the system from a custom UWL connector. The system alias is available in the method getItems(), but no hint whatsoever how to get the system object to the alias.
    I'm still investigating this, since i'm exactly at this point.
    Regards,
      Juergen

  • Business system VS application(java/ABAP)

    can u differentiate business system VS application(java/ABAP) in terms of proxy???

    Hi,
    ABAP Proxy :
    1. With ABAP proxy generation function it will be possible to generate ABAP proxy objects to an SAP system from an interface description in the SAP Exchange Infrastructure Integration Repository.
    2. ABAP proxy objects can only be generated for SAP systems that are based on SAP Web Application Server 6.40.
    If you use ABAP Proxy , you can reduce the overhead calling the function again and again.
    /people/vijaya.kumari2/blog/2006/01/26/how-do-you-activate-abap-proxies - Activate Proxy
    /people/siva.maranani/blog/2005/04/03/abap-server-proxies - ABAP Server Proxy
    /people/ravikumar.allampallam/blog/2005/03/14/abap-proxies-in-xiclient-proxy - ABAP Client Proxy
    Re: JDBC Sender select/update problem
    Java Proxy:
    1. JAVA proxy is used for J2EE based systems communicating with XI for sending or processing msgs in those J2EE based systems
    2.It allows java applications to interact directly to Integration server with avoiding the configurations for the special adapters
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/7d4db211-0d01-0010-1e8e-9b07fc2113ab - How To Work with XI 3.0 Java Proxies
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/a068cf2f-0401-0010-2aa9-f5ae4b2096f9- Java Proxies and SAP XI - The Inside Story, Part 1
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/f272165e-0401-0010-b4a1-e7eb8903501d - Java Proxies and SAP XI - The Inside Story, Part 2
    Regards,
    Kumar.
    P.S: Reward Points if Helpful!!!!!

  • Search help for local system directories in ABAP program

    Hi all,
    Can anyone tell the standard search help available for local system directories on the client system?
    Regards,
    MVD

    Hi,
    You can use this FM.
    <b>RZL_READ_DIR_LOCAL</b> - Get list of files within specific directory(Application Server)
    *& Report  ZDIRFILES                                                   *
    REPORT  ZDIRFILES    .
    PARAMETER: p_fdir            type pfeflnamel DEFAULT '/usr/sap/tmp'.
    data: begin of it_filedir occurs 10.
            include structure salfldir.
    data: end of it_filedir.
    *START-OF-SELECTION
    START-OF-SELECTION.
    * Get Current Directory Listing for OUT Dir
      call function 'RZL_READ_DIR_LOCAL'
           exporting
                name     = p_fdir
           tables
                file_tbl = it_filedir.
    * List of files are contained within table it_filedir
      loop at it_filedir.
        write: / it_filedir-NAME.
      endloop.
    Or
    <b>FILE_GET_NAME</b> - Retrieve Logical file path.
    Use Transaction 'FILE' to view/create logical file paths
    Hope this will help.
    Regards,
    Ferry Lianto

  • How can i do a  NW07 double stack system to standalone java engine

    Hi all,
    i need a hand to this task.
    So i have an Abap (BI) + Java (EP) double stack system which connect to an other Abap (BI, this is the backend system). The abap system from the double stack is useless. So i would like to reduce the double stack to the standalone java. Is there anyboday have any experiance to how to do this?
    I have tried to export as standalone and double stack too, the source system but at the install only JAVA i have got an error message:
    "Importing the Java dump from a double stack system into a Java Only system is not supported."
    So my question is , how can i export the java db from the double stack system for the new only java system?
    I hope some of them have an idea....
    Thank you very much for your help,
    Beeekaa

    Beeekaa,
    You are trying something very interesting. I have never done it myself but I think below steps may work.
    Source system: ABAP + Java system.
    Export only java using database specific tools u2013 this will export only SDM content.
    Take a database backup u2013 Here you will backup all the tablespaces including ABAP tablespaces.
    Target system u2013 Java only.
    Restore the database. Delete all the tablespaces other than SAPSR3DB.(this is where we have Java content)
    Launch SAPINST and try to import java, so that you will get the SDM content and it runs Java migration tool and changes the JAVA ID that we see in configtool to new number.
    Again I am just assuming here, I have not tried it.
    Thanks,
    Venkat.

  • System memory in java.

    Anyone knows how to detect how much memory is still available in the system by using java? I got java.lang.OutOfMemoryError exception. so want to know if there is a way to find out the memory of the system.
    Thanks!

    Hello,
    There are two methods for getting the memory details of the system on which the JVM is running. These are:
    Runtime.freeMemory( )and,
    Runtime.totalMemory( )These methods are stored in the Runtime class which is located in the java.lang package.
    The values returned ( bytes) by these methods are an approxomation, "but are perfectly acceptable".
    I hope this helps,
    -Marek.

  • System programming in Java

    Hai!!!
    Actully I'm working in Automatic distinction between the system progam & application programs. Is there any samples/source code of the system programs available in java???is it possible to distiguish between the system program & Application program by seeing the code??
    Cheers!!!

    Just curious what is it system programming in java? Can't recall any example...

  • How to read system eventlog using java program in windows?

    How to read system eventlog using java program in windows?
    is there any java class available to do this ? or any one having sample code for this?
    Your friend Zoe

    Hi,
    There is no java class for reading event log in windows, so we can do one thing we can use windows system 32 VBS script to read the system log .
    The output of this command can be read using java program....
    we can use java exec for executing this system32 vbs script.
    use the below program and pass the command "eventquery"
    plz refer cscript,wscript
    import java.io.*;
    public class CmdExec {
    public static void main(String argv[]) {
    try {
    String line;
    Process p = Runtime.getRuntime().exec("Command");
    BufferedReader input =
    new BufferedReader
    (new InputStreamReader(p.getInputStream()));
    while ((line = input.readLine()) != null) {
    System.out.println(line);
    input.close();
    catch (Exception err) {
    err.printStackTrace();
    This sample program will list all the system log information....
    Zoe

Maybe you are looking for

  • XFCE + dual monitor setup question

    Hi, I just used the wiki guides to install arch and xfce, the desktop is extended horizontally on my 2 monitors, I used aticonfig. the problem is if I start a an application in 1 monitor I cannot drag it to the 2nd monitor, how do I achieve that? thx

  • I am having problems with the sounds. Please help I am very worried about my iPad 2

    I tried restarting my iPad so the sounds would go normal but every time it goes to the homepage it's muted. When I receive a mail it's muted, when I am playing a couple of games it's sometimes muted and when I type it's muted. I checked the settings

  • Sun One Web Server Start Up Error

    I have added filters in my application. I get the below error when I try to restart my application from Sun One Web Server, info: CORE3282: stdout: PARSE error at line 6 column 10 info: CORE3282: stdout: org.xml.sax.SAXParseException: Element type "f

  • Passing option values through servlets

    how do i pass this option values into another servlet?? out1.println("<select name =\"delimiter\" multiple>");                                         out1.println("<option value = \"type1\">" + ";");                                         out1.prin

  • Java Project Versioning

    Hi I am building an internal lib that is made up of 4 packages. I want to give each internal release a version number, but don't know how. I using Netbeans IDE to develop my project