How to call a variable file path in javascript

Hi,
My objective is to capture a file path on mac and windows. However, this file path gets changed with various users.
For example the path is:
c:\user\username\AppData\Local\Temp\myfolder------> this is for windows machine
/users/username/Library/Application Support/tempfolder/Temporary Files/-------> this is for mac machine
As you can see, the path will be same for all the machines. Only the difference will be in searching the user and username at the start of file path. Rest folders will remain same on all the machines.
Is there any grep pattern through which I can call this complete path in a variable for all the users.
Any help will be appreciated.
Regards,
Abhi

Hi,
You are able to check OS:
var currOS = $.os;
regarding to value of this string you can switch to various paths
Jarek

Similar Messages

  • How to call a jar file from oracle forms (6i)

    Hi,
    I'm working with oracle 6i. I want to know that how to call a .jar file from forms menu. when I use HOST('<path>\test.jar') it is working in 'Client Server' any way. but the problem is I use application server in order to run my form. so my form is in the server and I run the form via clients web browser. in that case above solution will not work. if any body knows how to overcome this problem please reply.
    thanks.
    duminda

    I created a bean area and set the class name as implementation class. within that java bean class I called to a bat file which consists of the execution command of the jar file ( because i don't know how to call .jar file from my bean class directly).
    then i tried to run it in application server. its still not running.
    can you tell me what i have to do within my bean class? or can you suggest any solution?
    thank you.

  • How to call a .bat file from java code?

    How to call a .bat file from java code? and how can i pass parameters to that .bat file?
    Thanks in advance

    thanks for ur reply
    but still i am getting the same error.
    I am trying to run a .bat file of together tool, my code looks like below
    import java.lang.Runtime;
    import java.lang.Process;
    import java.io.File;
    class SysCall{
         public static void main(String args[]){
              String cmd="D://Borland//Together6.2//bin//Together.bat -script:com.togethersoft.modules.qa.QA -metrics out:D://MySamples//Metrics// -fmt:html D://Borland//Together6.2//samples//java//CashSales//CashSales.tpr";
              //String path="D://Borland//Together6.2//bin//Together.bat ";
              Runtime r= Runtime.getRuntime(); //Declare the system call
              try{
                   System.out.println("Before batch is called");
                   Process p=r.exec(cmd);
                   System.out.println(" Exit value =" + p.exitValue());
                   System.out.println("After batch is called");
              /*can produce errors which must be caught*/
              catch(Exception e) {
                   e.printStackTrace();
                   System.out.println (e.toString());
    I am getting the below exception
    Before batch is called
    java.lang.IllegalThreadStateException: process has not exited
    at java.lang.Win32Process.exitValue(Native Method)
    at SysCall.main(SysCall.java:17)
    java.lang.IllegalThreadStateException: process has not exited

  • Get (variable) file path and name in a text element

    How do you get the (variable) file path and name in a text element (label) in LCD? If you save the PDF and afterwards relocate it, it should update the values. Is that actually possible?

    Does anyone have any advice on this issue?
    Thanks in advance,
    Zack H.

  • How Do I get a File Path from a FileName?

    Hi there,
    I was wondering how do i get a file path(i.e) directory only from a file name.
    Say i got a file called "C:\Test.txt" is there a method in java that will allow me to only get "C:\"?
    I've tried getPath(), getAbsolutePath() and they all return the directory and the file itself.
    Please Help
    James

    String path = file.getPath();
    String name = file.getName();
    int i=0;
    for(i=0; i< (path.length()-name.lenth() ); i++){
    String temp = path.substring(i, i+name.length());
    if(temp.equals(name) break;
    return path.substring(0,i);

  • How to call a .jsp file from Applet

    Could any one guide me how to call a .jsp file from a Applet using action Event.
    Thanks

    http://javaalmanac.com/cgi-bin/search/find.pl?words=URL+post

  • How to call a .jar file from a java bean?

    any body knows how to call a .jar file from a java bean?

    Crosspost!
    http://forum.java.sun.com/thread.jspa?messageID=4349619

  • How to call a .jar file in JSP

    Hi Folks,
    I would like to know how to call a .jar file in a JSP page..
    Thanks in adv.

    Any web app creating tutorial can. You know, if this doesn't ring a bell with you at all, I don't really feel inclined to explain it to you because I think you shouldn't yet be dealing with JEE in the first place.
    http://java.sun.com/j2ee/tutorial/1_3-fcs/doc/WebComponents3.html

  • How to assign the downloaded file path in dropdown menu dynamically?

    I have one jsp page. In that jsp page one dropdown menu is there. Dropdown menu contains "save" and "saved content". I download the file using "save" option in menu. That downloaded file path is assigned to the below of the "saved content" option. Then i clicked that downloaded file path, that file will be open.
    My problem is how to assign the downloaded file path in dropdown menu. plz help me.

    dittu wrote:
    My problem is how to assign the downloaded file path in dropdown menu. plz help me.I don't understand your problem.

  • How to call the XML file as PrivateResourcePath in JSP

    Hi All,
    I want to call the layer-config.xml values in JSP dropdown list. How to call the XML file as PrivateResourcePath in JSP... please advise me if any solution.
    locaiton: dist/PORTAL-INF/layer-config.xml
      <?xml version="1.0" encoding="utf-8" ?>
    - <layer-config>
    - <system>
      <layer>Test</layer>
      <internal>true</internal>
      </system>
    - <system>
      <layer>Test1</layer>
      <internal>false</internal>
      </system>
    - <system>
      <layer>Test3</layer>
      <internal>false</internal>
      </system>
      </layer-config>
    Thanks in advance.

    Hi,
    The below link may help you.
    [Accessing image from dist/imgaes folder inside JSPDynpage Component;
    Regards,
    Suresh Bachimanchi

  • How to call a html file in a java file

    how to call a html file inside a java file ?

    Hopeless. Are you by any chance a rare gas? You seem completely inert. LOL You totally pwned him there :rolls eyes:
    well, no, I think he's looking for something to this degree:
    in HTML, there is a mailto: command that makes the system default handled way to email emails open up. He's looking for a command thats very nice and opens a html file in the system default browser.
    So, Dick, Runtime.exec would work execpt that he needs a way to find the default system browser to call exec on, AND he has to know how to pass html file locations to the executable via command line arguments
    He just didnt try to phrase it at all :P

  • How to specify the database file path when create FDM application

    Dear All,
    How to specify the database file path (MSSQL) when create FDM application?
    Right now, all data file are placed in the D:\ . I want to specify the database files (log and mdf file) in other place. How to do it?
    Thanks.

    Where is the highS2.xml located on the disk? If you add it to your project you should set its Build Action to Content and its Copy To Output Directory to Always in Visual Studio:
    Please remember to close your threads by marking helpful posts as answer once your issue has been solved and then start a new thread if you have a new question.

  • How to call a form without path

    how to call a form without path
    i.e.,
    we are calling a form as
    call_form('D:\casestudy\register');
    but without specifying path how to call a form?

    If you are new to Forms then please have a read through the Oracle Forms documentation that is on this web site - all is explained somewhere.
    This is a good start : http://download-uk.oracle.com/docs/cd/B25016_07//doc/dl/web/B14032_03/toc.htm

  • How to call .chm Help File

    How to call .CHM help file on click of button through the dialog? I tried using the command WinHelpCall() but unable to find the required result. Also could anyone please suggest how to I get a link/jump to the subtopics on click of help button under that module Example Under Navigator device if the help button is clicked the help file has to display Navigator Page.
    Can anyone provede me a quick suggestion.
    Thanks in Advance

    DIAdem doesn't have a method to open .chm files because these files are Microsoft help files, rather than DIAdem specific help files. However, there is a KnowledgeBase on Microsoft's web page that may be of help. You can find this document at http://support.microsoft.com/?kbid=209843. I found this by doing a web search for "Programmatically open .chm". I hope this helps you.
    Regards,
    Shannon R.
    Applications Engineer
    National Instruments

  • How to call windows help files .hlp from Java program

    Hai all everybody
    How to call windows Help file that is xxx.hlp files from java programs
    any help great!!!!
    regards
    veeru

    How about
    Runtime.getRuntime().exec("start xxx.hlp");

Maybe you are looking for

  • Where do I find all the Java files?

    First, let me say that I know very little about Java. I updated to "Java for Mac OSX 10.4 Release 6" using Software Update. The size of the Java update file is supposed to be 80.7 MB. Although I cannot identify any possible Java related problems, oth

  • G/l master data upload

    hi masters, if u want to upload g/l master data, how it is? is there any division like, upload open items and then upload reconsalation a/c or all accounts update at a time? pl explain

  • Long runnig queries

    Hello, We have some long runnig queries, One query in example have around 150 chars(49 in Default layout and 101in free chars) and 65 keyfigures- this query executes in RSRT within 3 minutes.. but if you try to execute in BEX (7.0) it gets Time out e

  • Adobe Reader XI seems to cause error messages with Internet Explorer

    Have just upgraded to Adobe Reader XI and now I get two error messages everytime I close a Internet Explorer window.  It was not a problem with the earlier Reader and does not occurr when I uninstall Reader XI.  I just close the error messages and th

  • Printer Error server-error-service-unavailable

    Im currently getting the errpr msg server-error-service-unavailable when im trying to connect to a printer. I have found out how to over come this problem by resetting the printer. Reset Printing System feature, follow these steps: In the Finder, cho