Generate file in same directory as current running process

Hi all:
I basically have a batch file in a particular directory that runs a Java program. Within the program, I am doing this:
//generate contact server file
String contactServer = "Testing...";
BufferedWriter bw = new BufferedWriter(new FileWriter("contactServer.txt"));
bw.write(contactServer, 0, contactServer.length());
bw.close();Now, what I would expect is that it would be generated in the same directory as the process that is running. However, when I do a search, it ends up in C:\Documents and Settings\Leonard\My Recent Documents.
How can I specify to generate it in the same directory as the current running process?

Now, what I would expect is that it would begenerated in the same directory as the process that is
running. However, when I do a search, it ends up inC:\Documents and Settings\Leonard\My Recent
Documents.let say your batch file is in
C:\Documents and Settings\Leonard\
and you run from
C:\Documents and Settings\Leonard\
and your application is in
C:\Documents and Settings\Leonard\My Recent Documents.
so..when you run the bat file, is output file created
in
C:\Documents and Settings\Leonard\
or
C:\Documents and Settings\Leonard\My Recent Documents.
it should be created in C:\Documents and
Settings\Leonard\
unless you create a shortcut to the batch file (which
is located in "C:\Documents and Settings\Leonard\My
Recent Documents." and move the shortcaut batch file
to "C:\Documents and Settings\Leonard\"...than the
output file will be created in C:\Documents and
Settings\Leonard\My Recent Documents.
make sure the batch file is not a shortcut to the
original batch file. the file will be created
wherever the batch (original) file is reside in"
Jesus man, thank you so much. Just like you suggested, when I actually used the batch file itself instead of the shortcut, everything worked out fine.
So, any suggestions on how to get it to generate in the same directory as the target of the shortcut, not the shortcut itself?

Similar Messages

  • How to get Application name of a current running process in LiveCycle??

    Hi,
    I want to get the Application name of current running process in LiveCycle as a output value.
    I have 3 applictions, the 3 applications are calling same SubProcess, so I want get the name of the application from which the sub process has been called.
    I want to retrieve the Application name and asssign this value to a output variable.
    I have searched for the solution I found a method getApplicationName() but inorder to get the current running process's Application Name this might not be useful..
    So suggest the way to resolve this..
    Thanks in Advance.....
    Regards,
    Kalyan Urimi

    Use an input/output string variable in the subprocess and set its value in each calling process as respective Application name.
    May be if this could help.
    Thanks,
    Wasil

  • Copying files from same directory as *.java files and moving to WEB-INF/classes/ package name

    In our current application we have the following source directory structure:
              src -
              - com
              - edeploy
              - subdirs ... (many directories here)
              - jsp
              -subdirs ... (many directories here)
              In com.edeploy.subdirs, there exists *.java files, and *.gxq files (query
              files). I would like to modify my build.cmd script to copy the *.gxq files
              into the same directory as the class files.
              Here's my script so far:
              @REM Create list of files to compile
              DIR /S /B /A:-D src\com\*.java >class.list
              @REM Create list of query files
              DIR /S /B /A:-D src\com\*.gxq >query.list
              @REM Compile
              javac -d stage\WEB-INF\classes @class.list
              @REM Copy query files into class directory
              .......... code needed here ......
              Can anyone help me with this?
              Thanks,
              Matt
              

    You may want to check out:
              http://jakarta.apache.org/ant/index.html
              Gary
              "Matt Raible" <[email protected]> wrote in message
              news:[email protected]..
              > In our current application we have the following source directory
              structure:
              >
              > src -
              > - com
              > - edeploy
              > - subdirs ... (many directories here)
              > - jsp
              > -subdirs ... (many directories here)
              >
              >
              > In com.edeploy.subdirs, there exists *.java files, and *.gxq files (query
              > files). I would like to modify my build.cmd script to copy the *.gxq
              files
              > into the same directory as the class files.
              >
              > Here's my script so far:
              >
              > @REM Create list of files to compile
              > DIR /S /B /A:-D src\com\*.java >class.list
              >
              > @REM Create list of query files
              > DIR /S /B /A:-D src\com\*.gxq >query.list
              >
              > @REM Compile
              > javac -d stage\WEB-INF\classes @class.list
              >
              > @REM Copy query files into class directory
              > .......... code needed here ......
              >
              > Can anyone help me with this?
              >
              > Thanks,
              >
              > Matt
              >
              >
              

  • Linking to a file in same directory?

    I am working with someone else to design a site, he is coding some pages and including a form. I want to link to this form on a page and I was told that it will be in the same directory as the rest of the site. I was told to use the following path:
    /teachers_staff/staffquestions
    How do I add this path to a link?
    Thanks.

    Hi Stan,
    in addition to osgood_'s hint, I would like to show you the steps in (Germam) DW:
    I named this page "form.html" and put it in a directory called "/teachers_staff/staffquestions". As osgood_ said, I did "Highlight the text on your page that you want to be the link" here "form.html" and used (Grmna DW) insert a Hyperlink, like this:
    Here I got DW's offer (among others in this directory) to pick "form.html":
    After that the link is active. In your source code you will find this:
    <p><a href="form.html">form.html </a></p>
    Hans-G.

  • How to stop a process chain after the current running process

    Hi experts,
    I try to stop a running process chain, but only at the end of the current process load.
    I try to unscheduled process chain : the job of the current process is killed and the process stop
    I try to execute the programm rspc_process_finsh : same result.
    Actually, I aim at waiting of the current process completion and stop the chain.
    Thanks and regards,
    Bobby

    Hi all,
    Thanks for answer.
    If I resume the situation :
    - Click on Unschedule process chain stop the current process. We have to change the status of the process in Yellow to Red.
    - Go to sm37 to kill the job change the statut in red.
    So there is no way to stop the running of a process chain only after the good or bad end of the last runnning process ?
    Example :
    My chain is running. The process which is running is a DTP loading process. There are 50 packages to load. I decide to click on Unschedule process chain when the package 18 is running.
    If I do that, the loading of package 19 will not start right ?
    So is there a way to wait that the 50 packages are loaded before that the system stop the chain ?
    Thanks in advance,
    Bobby.

  • Use of inlineframe to show a file under a directory in current WLS

    Hi,
    JDeveloper: 11.1.1.5.0
    WLS: 10.3
    My application creates PDFs in runtime under some directory of my "Managed Server" where the application runs. I need to show the generated pdf file in my application page.
    I am storing the location of the generated pdf in my pageFlowScope variable. In subsequent pages, I am trying to show the generated pdf thru inlineframe as:
    <af:inlineFrame id="if1"
    source="#{pageFlowScope.ContractLocation}"/>
    I am not able to see the pdf file getting displayed in my page. I am building the file path as below:
    System.getProperty("user.dir") + File.separator + "out" + File.separator + "Contract_1.pdf";
    Please suggest if my approach to show a file using af:inlineFrame is proper? And how to display the file which is somewhere under the current server running the application.
    Thanks
    Rathnam

    If your app knows the position of the file you just need to change the doGet method in the servlet. In this method you pass the path to the file, open a stream to the file and copy the file stream to the response stream. In this case you don't need the application module, as the parameter give you all needed information. In the end you should have something like
                // get path to file
                String filePath = request.getParameter("filepath");
                // Set the content-type. Only images are taken into account
                response.setContentType(mimeType + "; charset=utf8");
                File f= new File (filepath);
                FileInputStream lFileInputStream = FileUtils.openInputStream(f);
                ServletOutputStream lOutputStream = response.getOutputStream();
                IOUtils.copy(lFileInputStream, lOutputStream);
                lFileInputStream.close();
                lOutputStream.flush();Timo

  • Button Pointing to audio file in same directory

    I'm fairly new to Flash, but have gotten the hang of it for
    the most part.
    I'm trying to create audio buttons that will play vocabulary
    words when clicked on for a language learning website. I can create
    buttons that play audio when clicked, but as of now the only way I
    know how to do it is to add the audio directly to the swf file. The
    problem is this takes up about 24kb of space, and there will be
    about 20 copies of the button per page, each for a different
    vocabulary word.
    I was thinking it would be nice if I could use the exact same
    swf file to save on loading time, but have it point towards
    different audio files. Basically, I figure if the audio is built
    into the swf file, when the page loads it will take a long time,
    because it will load all of the audio along with the files. if it
    points separately, it will only load the audio when the button is
    clicked.
    Is it possible to do this? I've heard that you can use the
    object tag to point towards separate audio files, but am not too
    sure on how to pull that off. I'm just looking for a way to use the
    button I've created and keep speeds reasonable when loading the
    webpage. Loading 30 audio files at the beginning can slow it down,
    especially if they only plan on playing a couple of them. Each mp3
    is only a few kb larger than a swf file with the audio already in
    it, so the compression of mp3 in a swf (at least from what I know)
    didn't do too much for my case.
    I figure I can put all the audio files in a folder along with
    the swf file.

    Superman859 wrote:
    > I'm fairly new to Flash, but have gotten the hang of it
    for the most part.
    >
    > I'm trying to create audio buttons that will play
    vocabulary words when
    > clicked on for a language learning website. I can create
    buttons that play
    > audio when clicked, but as of now the only way I know
    how to do it is to add
    > the audio directly to the swf file. The problem is this
    takes up about 24kb of
    > space, and there will be about 20 copies of the button
    per page, each for a
    > different vocabulary word.
    http://www.kennybellew.com/tutorial/
    Very detail tutorials on Sound in flash, from basic stop/play
    to complex,
    dynamic players with all kind of bells and whistles
    Best Regards
    Urami
    <urami>
    If you want to mail me - DO NOT LAUGH AT MY ADDRESS
    </urami>

  • Open a file in same directory as app

    I am trying to open a separate app that is in the same folder as the form app i'm using. Is there a way to do it so i can move the folder with the files in it from computer to computer and still have it work. I'm trying to open it with a jbutton
    Thanks
    Edited by: aschreiner22 on Apr 21, 2008 3:33 PM

    aschreiner22 wrote:
    either another app, Look up the Process and Runtime class of the Java api. Usually if you want to execute another application like an .exe you would do this:
    Process p = Runtime.getRuntime().exec("anotherApp.exe");
    or a class embedded in an html.A class embedded in an html file? usually an Applet class. You can open the applet class like how you open other Java classes.
    SampleAppletClass sample = SampleAppletClass();A word of advice, try Google and search your questions in this forum before asking. Chances are that other people have already ask them. Lot of users of this forum do not like to answer questions that have been asked before. You may receive unpleasant replies if you're not careful.
    have a nice day!

  • Specific PP report for current running process in plant.

    Hello Experts.
    I have very RAW information to address this problem, which is described below.
    My Client requirement :
    They have various process running in the production plant.
    They want to see on one screen, how many total process running in the plant along with production order number and how much process has been completed (in %) vs Time (Date or Hours).  (something like giant chart ou Production order number with completion status in % vs Time)
    According to my knowledge, SAP doesn't provide this kind of plan board kind of solution.
    Again I understand this information is very raw, so if its possible then Please let me know, how can we see this kind of report on one screen,
    If any kind of report is available, which full fill this information than Please provide me information,
    Inputs are highly appreciated.
    Nixal

    Hi Nixal,
    Yes you are right, you can not achive this in standard SAP. I think you have to develop customise report for that. But first i suggest you just go through COOIS report available in the system. In this report there are too many options available, you can try out any as per your requirement.
    Regards,
    Hiren

  • Currently running process chains

    Hi Gurus,
    How can we find out if a process chain is still running.
    Regards

    goto Tcode RSPCM.
    Create new variant and give the process chain name.
    You can monitor the process chain once you do this.
    or
    double click on the process chain
    click on log icon.
    you can find the status icon in the left pane.

  • Currently running process name list and local port list display using java

    HI
    I have for truble to display Process name list and that process running local port number...
    like this output from java
    process localport
    ======= ========
    ccApp 1096
    orbd 1050
    postmaster 5432
    skype 443
    MSTask 1051
    can help any one with sample code Explain sample code wtih , this thread or . if you found sample code please send me [email protected]
    Best Regards
    P.SASIKUMAR

    If it's possible for C++ ,. can you give me the best sample and how to interact to java todisplay this result....

  • Generated file combining LOF and LOR

    Sorry if this is something I should have been able to work out for myself – it would be really handy to generate a document that shows me figure captions (a LOF including :figcap styles) and a list of graphics (a LOR including imported graphics)
    The aim is to have a single list I can hand over to people who need to know which file (or files) is referenced for each illustration. I've managed to make one with copy/paste, a text editor and a spreadsheet, but was wondering whether there might be a niftier solution.
    N

    You could generate a LOP that is built from just the paragraphs used in the LOF and LOR .
    It turns that this actually works, with a couple of caveats:
    Frame doesn't list the generated paragraph types, from generated files, in the LOP setup dialog. You need to add the generated para names (such as Heading1TOC or Level1IX) to the Para Catalog of a non-generated file.
    You probably have to run Update Book twice to capture in the LOP any changes to the other generated files.

  • How to obtain list of running processes

    hi all,
    can someone point me to the documentation that can help me obtain a list of currently running processes. i want to write a java program that can scan through this list to see if certain processes are currently running.
    thanks!

    My answer works fine in unix systems. I try to look for processes that are owned by user "nobody"
    Try this and let me know if you got the answer
         psProc = Runtime.getRuntime().exec("/bin/ps -ef");
              psBr = new BufferedReader(new InputStreamReader(psProc.getInputStream()));
              while( (newline = psBr.readLine()) != null) {
              strBuffer.append(newline + " ");
              strToken = new StringTokenizer(strBuffer.toString()," \t");
              while(strToken.hasMoreTokens()) {
              tok = strToken.nextToken();
              if (tok.startsWith("nobody")) {
                   //this is the process you want
              }

  • Generating a print doc deletes other docs in the same directory

    Generating a new doc into a directory that contains a different doc generated off the same Word template causes the older doc to be deleted.
    MY RH8 project is set up with a number of Print Documentation SSLs, one for each chapter of a book, all to use styles from the same Word template. Each SSL has the same Location selected, so all the chapters are by default created in a common directory, where each can be tweaked as needed and later all merged into a single PDF for distribution.
    But as each doc is generated, the previously-generated doc in that directory disappears. The newer and older files have different file names, were generated by different RH Printed Documentation SSLs, but the SSLs refer to the same Word template. If a previously-generated doc is still open in Word when I generate the next, then I get the "[template name] is locked for editing" prompt, I select "Open a Read Only copy", it runs on to completion, and then both docs are present in the directory as expected.
    The selected output can be doc, docx, or pdf, and always the earlier file is deleted. The selected Location in which the files are created can be inside the project or outside the project. It makes no difference whether the template's properties are set to Read-only.
    An obvious workaround is to copy each file out to a different directory as soon as the file is generated. But RH deleting differently-named files is so obviously a malicious thing to do, I can't be working it right. Any ideas?

    When you generate a Print Doc SSL, a log file with name <ProjectName>.log is created along with the generated word doc(s) in the output folder. This log file contains the name of the previously generated word doc(s). When a Print Doc SSL is re-generated, it read the name of previous word doc from the log file and deletes it and creates a new word doc with possibly new name given in the SSL settings.
    So, this is the normal behaviour of RoboHelp and works correctly if each Print Doc SSL is generated in separate folders. But when all the Print Doc SSLs are generated in the same output folder then the current SSL reads the log file of the previous SSL and hence deletes the previously generated word doc in that output folder.
    Workaround:
    1. RoboHelp has an option to generate individual Word Document for each Chapter, it can be used instead of Multiple SSL with one Chapter each.
    2. If you can't use the first option for any reason, then delete the <ProjectName>.log before generating the each Print Doc SSL.

  • I generate file (PDF, HTML, etc) the report is empty but I run in paper

    Hi
    I use oracle Report10g
    When I generate file (PDF, HTML, etc) the report is empty but I run in paper design show data, the report in the paper design show many pages, when generate file show only the information of the margin in the main seccion and the body is empty,
    Thanks

    Thanks Daniel for pointing that out.  Though you answer is helpful but I am not sure if that is what I would want to do.
    The link you provide for csv says "For each report there's an _report.xdo file that contains the XML structure of the report... "   It suggests I modify the .xdo file for each report.  I currently have 16 reports.
    Does it mean I modify the .xdo file for all 16  and what happens if someone creates a 17th report ?
    Also, what if I run the same report using different input parameters will that change the xml structure for the report  and therefore will need me to modify the .xdo again ? (I think it should not change the xml structure so the answer should be "NO" to that, unless I change the structure of the report).
    Finally, the link you provide says after doing what it suggest  "Now log back into BI publisher and select the report. You should now be able to see that CSV is now an option."
    CSV should be an option where ? on what screen/page ?  Maybe PDF is already an option for me that I cant see because I do not know where that option is.
    I was hoping there would be something I could do on the xdo_metadata sheet (in the data constraints section or elsewhere) OR in BI Publisher itself as some property of the report.
    I will try out what you suggest any ways.
    M. Jamal

Maybe you are looking for

  • Songs that appear in my ipod when connected to itunes disappear when discon

    when i connect my ipod color - 60g - to i tunes..all playlists show...when i add or delete songs, it apprears in the itunes directory under my ipod...when i disconnect my ipod...none of the changes show on the ipod....any ideas???

  • Receive email attchmnt, store in SAP & link to PO

    Hi Experts, We have a requirement to convert PO to PDF and send it as an e-mail attachment which is possible . But the requirement is to add digital signature to the PO and  send it as E-mail attachment. Also once vendor confirms and signs the same d

  • Getting user account lockout continuosly

    I am getting lockout continuosly for one account. I tried reconfiguring user profile and system restart. But still user account lock out coming.. I enabled audit logs and found failed logs. In that i am getting caller process id as 0x1a8.  I installe

  • SM: EXEC SERVICES Job is Cancelling

    Hello everyone- I have seen a few posts about this job cancelling however I haven't been able to gather a solution from what I have read. After appling SP15 in our Solution Manager system, the SM: EXEC SERVICES job is failing. We sent a note off to S

  • Can anyone help on Validations

    Hi SDNers, I am facing a problem with validations. Here is my requirement. I had a field (Phone Number). In that business will enter either Lanline Number ot Mobile Number. Ex - 0444 12345678 or 044 12345678 These are land line numbers. ex:- Mobile n