How to change to new file directory?

From within a java application, I need to change to a new file directory, similar to the cd shell or window command. I could find no methods in the File class that will accomplish this task. I need a setCurrentDirectory method, similar to that of JFileChooser, that will move to a new directory path.

I did the chdir to work following the original advice. At least when executing java.exe, the following form of Runtime.exec() whas required.
Runtime rt = Runtime.getRuntime();
rt.exec(String command, null, new File(String workingDirectory);
The command parameter string would include java.exe, plus any classpaths, the class being executed, and any arguments.
Also, remember that a runtime process is run in a separate shell; a separate thread is spawned
Thanks very much to the person who provided the advice.

Similar Messages

  • Is it possible in KM to change "create new file" dialog?

    Is it possible in KM to change "create new file" dialog (Folder -> New -> Text File...) on consecution of my own screens(I mean user inputs information, presses next button, then again inputs information and so on)? And if its possible, could you please tell me how to do this. I'm new to KM as well as to SAP EP...

    Hi Aliaksei,
    the PDF referred to mainly explains how to configure commands (within layout sets etc), but as far as I understand your question, you want to develop your own screenflows / command. First, I definitely would disadvise a beginner in the EP/KM area to start with such a task...
    Anyhow, there is a one-step-screenflow-command tutorial on SDN: https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/kmc/implementing flexible ui one-step-screenflow.article
    For more steps, you could start decompiling a command class of a command which is more or less similar to your needs (and the underlying classes) to get further insight.
    If you really should get that far and have implemented your own command, you just can switch the implementation class if you want to change the logic for an existing command under System Admin - System Config - KM - CM - UI - Commands - UI Commands - <command in question> Java Class setting.
    Hope it helps
    Detlev

  • How to change the saplog.ini directory?

    Dear all,
    The default directory of SAPGUI logon configuration file is %windir%, now I want to change this configuration file directory, how to change it?
    Please help me.
    Passion

    Wu -
    We keep ours under C:\Program Files\SAP.  To do this we modified the system variable SAP_LOGON_INI_FILE to reflect the path we wanted it to be.  We did this by inserting the registry entry under HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Enviroment when it is installed.
    Hope this helps.
    Regards,
    Zecher

  • How to create a new file

    hello
        how to create a new file myfile.txt in folowing URL
         http://www.mydomain.com/upload/myfile.txtregards

    the_Orient wrote:
    corrected code
    I will to create a text file on webserver
    this file hasethe content "Hello World"
    </div>
    try
    String  S="Hello World"
         URL url = new URL("http://www.mydomain.com");
         URLConnection hpCon = url.openConnection();
         hpCon.setDoOutput(true);
         File file = new File("http://www.mydomain.com/studentes/info.txt");
         file.createNewFile();
    // how to use FileOutputStream  here
    OutputStreamWriter out = new OutputStreamWriter(hpCon.getOutputStream());
         out.write(content);
         out.close();
    }catch(Exception ex){ex.printStackTrace();}     
    Exception :
    java.io.IOException: The filename, directory name, or volume label syntax is incorrect
    {code}
    regards
    Whoa! Do you know what you're doing? Do you have permission to write on that URL? Or does the pathname parameter you passed on File is correct? How about let the server-side handle the creation of file for you by just requesting it? Do you know how to create a server-side Java program (e.i. Servlet)? Umm.. There's a Java tutorial for this for you to get started: [Reading from and Writing to a URLConnection|http://java.sun.com/docs/books/tutorial/networking/urls/readingWriting.html].
    Ron
    Server-Side Development Team
    [Java-Man 2004|https://sites.google.com/site/raisoftware6/]

  • How can we access the file/directory system in the server

    Hi friends,
    I have made a text editor attached with an audio player for my project.
    Both text editor and audio player are implemented in applet and put in to a
    jsp page using jsp:plugin. Text editor and player are separate applets running
    in the same page and from same server.A client who is using this editor may
    want to save the edited text files to the server as well as hear audio files from
    directories in the server.
    My question is how can we access the file/directory system in the server
    like we do in the local machine.When the user cliks save or openfromserver button
    in the editor, folder/files in the server must be displayed as we do with FileChooser.
    I am using Apache Tomcat 5,wiindows 2000 server, jdk1.5.
    manu

    You can't access it directly. But your applet can make net connections to the server, and the server can provide that kind of functionality. Generally this is easiest by making HTTP connections and having the server provide the functionality via the web server. (So in your case, JSPs or servlets on the server would list/deliver/create/modify/delete files, and the applets would invoke those JSPs and servlets.

  • How can i add new files to my ipod from a different computer  without losing the added files on my ipod?

    how can i add new files to my ipod touch from a diferent computer without losing the added files already on my ipod?

    Email them? Use DropBox?  What type of files?

  • Do anybody know how to change a PNG file from 1760 width by 1369 height to 800 x 600?

    Do anybody know how to change a PNG file from 1760 width by 1369 height to 800 x 600?

    Crop to 4x3 aspect ratio, then resize to 800x600

  • How to change the RPD file name without deploying on EM

    Is there a way to change the RPD file name so it doesn't have BI0002 or BI0003 on the end of it? I can delete my BI0002 file and point the NQSConfig.ini file to my new FileName.rpd but when the BI services restart the BI0002 file reappears in the repository directory and the NQSConfig file changes to reflect this. It's like the only way you can change this is in the Enterprise Manager, but that always adds the suffix to the file.
    Any suggestions?
    Here's what the docs say:
    When you upload a repository, it is copied to the local repository directory for each Oracle BI Server component, located at:
    ORACLE_INSTANCE\bifoundation\OracleBIServerComponent\coreapplication_obisn\repository
    If you have published the repository in shared mode, then the repository is also copied to the shared network location.
    After the repository is uploaded, it is given a version number suffix (for example, SampleApp_bi001.rpd). This version number is incremented each time that the repository is uploaded. To revert to a previous version, you must re-upload the specific version of the repository to use.
    Note that you can delete older versions from the repository directory or shared network directory to reclaim disk space.
    What does that mean? I have to use an old rpd file in order to get rid of the suffix?

    Hi,
    It can be changed, although I do not no exactly how. You have to take a look at the MBeans which are used to deploy a new repository. The suffixed is used to insure you do not overwrite an existing RPD
    Cheers,
    Daan Bakboord
    http://obibb.wordpress.com

  • How to change the excel file name which is in Application server...

    hi friends,
    my requirement is getting failed, when i'm trying to change the file name which is in Application server using the FM: SXPG_COMMAND_EXECUTE.
    when i execute above FM, i can see all my required details in SM69 like:
    COMMAND NAME: ZSPOOL_TEST1      
    OS: Windows NT
    TYPE: Customer 
    OS COMMAND: cmd rename Y:\OBRZ.PDF OBRZ38582.PDF
    once the above FM is executed, i'm getting SY-SUBRC = 2 (exception: COMMAND_NOT_FOUND).
    so, can any one guide me how to resolve this issue or is there any other way to rename the file which is in AS?
    thanks in advance...

    Hi ,
    First you can tranfer the AS server file to a new application server file.
    Then you delete the original file .
    To do that you can write code as follows --
    DATA : w_file(8) TYPE c VALUE 'FILE_NAM', " your present AS file name
           w_new(8) TYPE c VALUE 'NEW_FILE',
           fs_itab(255) TYPE c,
           t_itab LIKE TABLE OF fs_itab.
    OPEN DATASET w_file FOR OUTPUT IN BINARY MODE.
    DO.
      READ DATASET w_file INTO fs_itab. " Reading value from the AS file to field string
      IF sy-subrc NE 0.
        EXIT.
      ELSE.
        APPEND fs_itab TO t_itab. " Populating internal table form the file value
      ENDIF.
    ENDDO.
    OPEN DATASET w_new FOR INPUT IN BINARY MODE. " creating a new file if that does not exist
    LOOP AT t_itab INTO fs_itab.
      TRANSFER fs_itab TO  w_new. " Transfering to file
    ENDLOOP.
    CLOSE DATASET w_file..
    DELETE DATASET w_file. " Dleting the old file
    CLOSE DATASET w_new.  " Closing the final file
    Regards
    Pinaki

  • Need to add date/time stamp to file name without time change creating new files

    We have setup our application to save data once a trigger event occurs. We also need the date/time stamp as part of the file name. We used Format Date/Time String and concatenated it into the file name. It all works good, but as the time changes (seconds, minutes, etc.) it causes the Write to File to create a new file with the new filename. Is there a way to create the file and save/latch/buffer the time in the file name so that it doesn't create a new file for every second?
    I've attached a shot of the relevant part of our VI. It's all in a big while loop. The data save is in a case/switch so that when it is triggered it starts saving. (The for loop is to split the data up
    into 4 different files). Like I said, it all works except new files are created every second as the time changes instead of just putting it all in one file with the initial time in the file name.
    Attachments:
    TimeInFileNameQuestion.jpg ‏46 KB

    I need a loop in order to use a shift register. I cannot stop the outer while loop (because it would stop the hardware from collecting data), and I cannot add loops inside which bogs down the processor to where the app stops. I've attached a simpler version of my VI which illustrates the problem. While the button is pressed (the trigger) it should save the data (in this case just cycle numbers) into one file with the initial date/time. But, you can see that it creates 1 file/second. I tried using shift registers, but without adding extra loops I can't see how to do it. Thanks
    Attachments:
    FileNameTest.vi ‏29 KB

  • How to back up 'new files only' to external hard drive?

    not sure i'm doing this the best way....  any suggestions would be great!
    i have my master photo/video library on my desktop (using a file tree that i've grown & know exactly where things are since 2003- (pre mac).
    that file is on mac + saved to an external hard drive.  i back this up to my external often, BUT I'm not sure if i'm doing it the best way.
    i add photos, change the master file name w/ current 'added to' date, then drag or copy to the external hard drive and it copies/writes.  then i go and delete 'older file date' to keep space on external.  i've tried to copy using the w/o changing the file name, but then i have 2 copies of same file name on back up and i have to browse to see which one has the new photos?!  is there a way to add only the 'new' photos/files to the external instead of doing a complete copy, then i can go and update the file name w/ a current date?  concerned that my method of add new master file/ delete old master file will create eventual problems on the external?

    BenB wrote:
    The auto-backup is the database only, not the media.
    To back up the whole Library totally, first make sure to Consolidate it, then simply drag-and-drop it on to the backup drive, that simple.
    The KB article referenced by Karsten suggests one additional step: make sure your copy of the library is not at the root level of the drive to which you are copying it. I have not clue why this might be important.
    Herewith:
    Back up your Project Library and events using the Finder
    To create a single backup copy of your Project Library and events, you can copy the Final Cut Projects folder and Final Cut Events folder to an external storage device.
    If you are backing up incrementally, create a folder structure that helps you easily navigate through your backup folders. You could label the folders with the date you made the backup copy, for example.
    Important:    To avoid issues, it’s essential that you place the backup files in a folder (named “2012 Final Cut Pro Backups,” for example) that is not at the root level of your external storage device.  
    In the Finder, locate and select your Final Cut Projects folder and Final Cut Events folder.Your Movies folder is the default location for all project and event files:/Users/username/Movies/ Important:    If you moved a project or event after you created it, it will not be in the default location.
    Drag the Final Cut Projects and Final Cut Events folders to the external storage device.
    The folders are copied to your external storage device.

  • How to make a new file folder on screen?

    How to make file folder on screen?
    How to make a new window in browser?

    me1965 wrote:
    How to make file folder on screen?
    How to make a new window in browser?
    Don't know what OS you have so this info is for ICS.
    To make a folder on screen, long press on one app and drag and drop it on top of another app.  You will kinda see both apps there now and when you touch it a folder will open up and you can choose one of the apps.  You will also now be given a chance to name the folder.
    To open a new window in the chrome browser, tap on the menu button (the 3 verticle dots in the upper right hand corner of the screen) and click "new tab"
    If you have a different OS, let us know and someone will post the answer to your questions.

  • How to change the Rule file Pointing Automatically?

    Guys,
    Is there any automated way to change the rule file pointing for any application \ DB.. If so, can anyone ellobrate it briefly.....
    Regards
    Srini

    Do you mean you want to use a dimension/data rule that you created in one database and use it in another? Or do you mean you want to reassociate the rule with its new database?
    The former is easy -- copy (or not, the rule can be local) the rule to the new location and use MaxL/Esscmd to load data/dimensions.
    If you mean the latter, I don't know of a way to do that -- typically copying a rule file would only occur when the dimensionality is the same.
    Or do you mean something completely different?
    Regards,
    Cameron Lackpour

  • How to change a docx file to a pdf file

    trying to send an invite that is a .docx file - can't read it when sent out via email. how to change to pdf?

    Hi Amy ,
    What are the challenges you are facing while sending the ".docx" file ?
    Try saving it as an Adobe PDF first and then try to send it .
    Open the .docx file >Click on File tab and under the drop down menu choose Save as Adobe PDF and save it .
    OR
    Open the .docx file> Select the Acrobat option from the menu bar and choose the first option ,i.e Create PDF and save it .
    Please let us know your feedback.
    Regards
    Sukrit Dhingra

  • How to change the source file of audio elements

    Hi,
    I am using adobe edge version 3 to add audio to a website.I use both .ogg and .mp3 files.
    Inside the _edge.js file the audio element has 2 sources (one for .ogg and one for .mp3)
                    id: 'audio_element_id',
                    type: 'audio',
                    tag: 'audio',
                    rect: ['0', '0','320px','45px','auto', 'auto'],
                    source: ['source_file.mp3','source_file4.ogg']
    I want to change the source file of the audio_element programatically......
    So i am using the following code inside edgeActions.js to change the source
    sym.$("audio_element_id")[0].src="new_source_file.mp3";
    But this will change the source of both(.mp3 and .ogg ) to  new_source_file.mp3
    I want to change the source induvidually. What should i do??
    Also I wanted to know what " [0] " stands for in " sym.$("my_audio_element")[0].play(); "
    Please give me an example of a situation wherein i have to change the value of [0].
    Thank you
    Nithin

    you should create a different directory for each dvd on your hard drive and put the files where they belong eg: dvd1, dvd2, dvd3
    then create 3 bins in your project manager called dvd1, dvd2, dvd3 and put the relevant files into the bins ( can import whole folders into each respective bin )
    OR rename your files using something like " renamer" before importing to premiere
    otherwise youll have a mess of a time trying to figure out whats what...maybe someone else has a better solution

Maybe you are looking for