Windows and bat files

Hi
I've made some bat files to compile java sources and run the program.
After the termination of the program i want the bat file to stop and let me see the messages on console but it closes automatically.
I tried put pause at the end of the bat file but it does not work.
Just after finish the java program the console exits and never executes the pause command.
Why ?
how Can I do ?

I tried this one windows XP and it worked fine:
Test program: public class Test {
    public static void main(String[] args) {
     System.out.println("Test program running");
     System.exit(1);
}Batch file (called runtest.bat): java -classpath c:\temp Test
pauseThen I created a shortcut to "runtest.bat". It opened a console window and paused with this output: C:\temp>java -classpath c:\temp Test
Test program running
C:\temp>pause
Press any key to continue . . .How are you running the batch file? Is it from a shortcut on Windows, or from a third party tool, like an editor?
What is the command line you're using to run the batch file?
Tim

Similar Messages

  • [svn:bz-trunk] 18061: Added svn:executable property to sh and bat files

    Revision: 18061
    Revision: 18061
    Author:   [email protected]
    Date:     2010-10-07 06:57:08 -0700 (Thu, 07 Oct 2010)
    Log Message:
    Added svn:executable property to sh and bat files
    Property Changed:
        blazeds/trunk/servers/apache-tomcat-6.0.29/bin/catalina.bat
        blazeds/trunk/servers/apache-tomcat-6.0.29/bin/catalina.sh
        blazeds/trunk/servers/apache-tomcat-6.0.29/bin/cpappend.bat
        blazeds/trunk/servers/apache-tomcat-6.0.29/bin/digest.bat
        blazeds/trunk/servers/apache-tomcat-6.0.29/bin/digest.sh
        blazeds/trunk/servers/apache-tomcat-6.0.29/bin/setclasspath.bat
        blazeds/trunk/servers/apache-tomcat-6.0.29/bin/setclasspath.sh
        blazeds/trunk/servers/apache-tomcat-6.0.29/bin/shutdown.bat
        blazeds/trunk/servers/apache-tomcat-6.0.29/bin/shutdown.sh
        blazeds/trunk/servers/apache-tomcat-6.0.29/bin/startup.bat
        blazeds/trunk/servers/apache-tomcat-6.0.29/bin/startup.sh
        blazeds/trunk/servers/apache-tomcat-6.0.29/bin/tool-wrapper.bat
        blazeds/trunk/servers/apache-tomcat-6.0.29/bin/tool-wrapper.sh
        blazeds/trunk/servers/apache-tomcat-6.0.29/bin/version.bat
        blazeds/trunk/servers/apache-tomcat-6.0.29/bin/version.sh

    Well, I've tried compiling a package and I have modified the PKGBUILD file to look like this now. (Keeping it as simple as possible)
    pkgname=dvbcut-svn
    pkgver=16
    pkgrel=1
    pkgdesc="DVBCUT-svn is an application that allows you to
    edit MPEG files. ie: Remove TV ads. (SVN version: Fri, 01 Dec 2006)."
    url="http://dvbcut.sourceforge.net"
    depends=('qt' 'libao')
    makedepends=('subversion' 'scons')
    conflicts=('dvbcut' 'ffmpeg')
    provides=('dvbcut')
    source=()
    md5sums=()
    _svntrunk=https://svn.sourceforge.net/svnroot/dvbcut/trunk
    _svnmod=dvbcut
    build() {
    cd $startdir/src
    svn co $_svntrunk --config-dir ./ -r $pkgver $_svnmod
    cd $_svnmod
    msg "SVN checkout done or server timeout"
    msg "Starting make..."
    make || return 1
    # vim:syntax=sh
    I then run makepkg PKGBUILD and let it do its thing
    It ends with this...
    scons: done building targets.
    ==> Removing info/doc files...
    ==> Compressing man pages...
    ==> Stripping debugging symbols from libraries...
    ==> Stripping symbols from binaries...
    ==> Generating .PKGINFO file...
    ==> Generating .FILELIST file...
    tar: *: Cannot stat: No such file or directory
    tar: Error exit delayed from previous errors
    ==> Compressing package...
    tar: *: Cannot stat: No such file or directory
    tar: Error exit delayed from previous errors
    ==> Finished making: dvbcut-svn  (Sun Jan 21 19:08:28 UTC 2007)
    I'm not sure what's causing this error message.
    tar: *: Cannot stat: No such file or directory
    tar: Error exit delayed from previous errors
    I'll try installing it and see how it goes.

  • Windows 7 & bat files & login script

    We have Netware 6.5 SP8.
    How can I run a bat file from the login script so that it will "Run as Administrator" on the Windows 7 workstations?
    Thanks...

    Actually this is more of a MS/Win7 batch processing question.
    In short, you can't assign Admin rights to batch files, only to EXE or
    shortcuts.
    Therefor, try creating a shortcut to the batch file.
    Right-click on the shortcut -> Properties -> Shortcut tab -> Advanced.
    Click "Run as administrator".
    Test locally.
    Now you can try passing that shortcut to the Login Script command
    handler - something like:
    #cmd /c start [shortcut]
    or
    #%<comspec> /c start [shortcut]
    Note, this is all untested and unsupported.
    Good luck
    Wolfgang
    On 28.06.2012 20:46, ncharleyhog wrote:
    >
    > We have Netware 6.5 SP8.
    >
    > How can I run a bat file from the login script so that it will "Run as
    > Administrator" on the Windows 7 workstations?
    >
    > Thanks...
    >
    >

  • Problems with libs in jar and .bat file

    I have a third party library in a jar, let's say LIBRARY.JAR. Then I have my program which uses classes in that Jar, let's call it Program.JAR. The main class is program.Main.class. And I want to write a batch file so that it set's the classpath ro the LIBRARY.JAR, and runs program.Main class. Could anybody help me? I can't manage so far...

    For Windows the batch file could containjava -classpath LIBRARY.JAR;Program.JAR program.MainFor *nix, use : instead of ;                                                                                                                                                                                                                                                                       

  • Moved from Mac to Windows and DNxHD files will not relink

    Hi, as I have benn having problems getting '1080p/25 DNxHD 36' files to play smoothly on Mac I have booted into windows and thought I would give it a go.  I installed the Avid Codec pack and launched the project.
    It came up with the relink dialog and I started selecting the files (bit annoying, what if it was a big project, would I have to spend a day just relinking). I select the first file and got a error saying 'canont link media' and 'The selected file canot be relinked because its type (audio) does not match the original file's type (audio and video)'. so I clicked cancel. I played the file in windows and it had audio and video.  I then tried importing it in premiere and it thinks it is audio only;(.
    Any ideas?
    Ben

    If you attempt to start a new project and import one of those files does it allow you to simply import them?

  • MARS - NFS on Unix Services for Windows and deleting files

    Hello !
    I've prepared NFS server on W2k3 server with Unix Services for Windows installed. It works OK, the only problem is moveing/deleting files and folders. It seems like a problem with permissions for anonymous user. Does anybody have similar experience ?

    If you receive the following error message "Error ./pnarchiver Thread 2051:PN-0102:SQL error: ORA-01005: null password given; logon denied" then there is a Problem with archiving to NFS server. The directories for the archiving are properly created on the server but those directories remain empty. The workaround is that an inter operability issue exists between MARS and CygWin NFS server running on Windows 2003 server. To work around such inter operability issues, replace the NFS server with Microsoft Windows Services for Unix.

  • Resize windows and manage files in save/open dialogs?

    1. How to resize windows by dragging any border or corner?
    2. How to manage files via a Save/SaveAs or Open dialog (rename, delete, copy other files, etc...)?
    My search on these two things only comes up with comparisons and debates about Win vs Mac. Not relevant to the questions! I already run Win XP in Fusion when I have to for work. I don't want to run Windows; I just want to eliminate a couple Mac shortcomings since Apple hasn't. Yet. Maybe it has to do with patents...
    Anyway, does anybody know of a utility or other way to enable these functions in Mac OS 10? (I've tried Pathfinder; it doesn't quite do the trick.)

    I believe you will find a couple of third-party utilities that provide some enhancements for windows. As for file dialogs I can only recommend Default Folder X. You will find these at VersionTracker or MacUpdate.

  • WINDOWS 7 .bat file to Linux share

    Hi
    We have two new windows 7 pcs which have their drives mapped at net log on.  
    Every drives maps until it reaches that drive located on a Linux server.  Which at this point the user is prompted for a password,
    when the details are entered the drive doesn't map.
    the batch file works on windows xp pc's fine the only difference appears to be windows 7

    Hi,
    You may update all the drivers and ensure all the updates have been applied.
    This can also be caused if your DHCP server is slow/congested, or if your LAN switch is having trouble putting the port in the right VLAN
    Can you run the batch in Safe Mode with networking? If it works, I suspect that the issue is caused by your security programs or firewall.
    You may try to manually use  UNC (\\server\share) and IP (\\ip.add.res.s\share) to map the drive for a test.
    Hopefully you could resolve your issue soon.
    Regards,
    Blair Deng
    Blair Deng
    TechNet Community Support

  • Windows and Nib files

    Hi
    I have three windows in my MainMenu.nib file
    #import <Cocoa/Cocoa.h>
    @interface learnWindowsAppDelegate : NSObject <NSApplicationDelegate>
    NSWindow *window;
    NSWindow *Awindow;
    NSWindow *Bwindow;
    IBOutlet NSButton *open;
    IBOutlet NSButton *close;
    @property (retain) IBOutlet NSWindow *window;
    @property (retain) IBOutlet NSWindow *Awindow;
    @property (retain) IBOutlet NSWindow *Bwindow;
    - (IBAction)Open:(id)sender;
    - (IBAction)Close:(id)sender;
    when i build and run the project windows A and B appear
    I can close then by using Open and close button - but how would i stop them appearing when you run the project
    i.e only see them if you click Open or close them via the Close button
    Regards
    Tony

    If you don't want a window to be visible initially, change the window's behavior in Interface Builder. Select the window in Interface Builder and open its identity inspector by choosing Tools > Attributes Inspector. Deselect the Visible At Launch checkbox.

  • SQLPLUS from Windows Batch (.bat) Files

    I am executing a SQL script from within a windows batch file using the SQLPLUS command.
    sqlplus %MAX_ORA_USER%/%MAX_ORA_PASSWORD%@%MAX_ORA_DB% @MAIDIOUT_PS_TEST2.sql
    On exit, the SQL returns a code EXIT 0 (Success) or EXIT 2 (Warning).
    I want to be able to capture the value of the exit in the WINDOWS batch file and take some action.
    QUESTION: Does someone have a code example on how to capture hte EXIT value in the Windows Batch file?
    thanks,
    Philip

    Try one of the following constructs:
    IF ERRORLEVEL <x> <command> [ELSE expression]
    IF %ERRORLEVEL% == <x> <command> [ELSE expression]
    GOTO label_%ERRORLEVEL%
    :LABEL_xThe first construct to perform <command> any time the errorlevel is greater or equal to x.
    The second construct will perform <command> anytime the errorlevel equals x.
    The third construct will jump to the specified label with the value of errorlevel appended to it.

  • Maxdor OneTouch 4 Plus formatting for windows and Mac files

    Is it possible to format/partition a Maxdor OneTouch 4 Plus for accept both Mac and Windows files? If yes, how is it done?

    I'll give your suggestion a try - as soon as I can get the program to load. What am I doing wrong? I plugged in the Maxtor per their instructions. My Mac recognizes the icon on my desktop and I can open it. However, the "Mac OneTouch" icon does not open either by double clicking or by choosing "File", "Open". The user's manual opens and i've followed it's instructions as well as gone to the Seagate website and used their installation tutorial. What more should i do before I return the thing?

  • Windows and Office files related to MS Forms

    After installing some video-applications, Excel (old version: Office97) won't start showing a userform anymore. The command to show the userform initiates Excel to crash instantly. Problemsignature (in Dutch):
    Probleemhandtekening:
      Gebeurtenisnaam van probleem:    BEX
      Naam van de toepassing:    EXCEL.EXE
      Versie van toepassing:    8.0.0.3612
      Tijdstempel van toepassing:    32b0d09e
      Naam van foutmodule:    StackHash_aeca
      Versie van foutmodule:    0.0.0.0
      Tijdstempel van foutmodule:    00000000
      Uitzonderingsmarge:    PCH_9E_FROM_ntdll+0x0003CEEC
      Uitzonderingscode:    c0000005
      Uitzonderingsgegevens:    00000008
      Versie van besturingssysteem:    6.3.9600.2.0.0.768.101
      Landinstelling-id:    1043
      Aanvullende informatie 1:    aeca
      Aanvullende informatie 2:    aeca907265c4b042ef2459b377175aa8
      Aanvullende informatie 3:    f11d
      Aanvullende informatie 4:    f11de824c7832f8b45fe54a2406056bf
    Uninstalling the video-applications, reinstalling Office and even systemrecovery weren't of any help.
    Can anybody tell me which
    Office files
    Windows files (W8.1)
    Windows registry entries
    are related to MS Forms and can be the cause of this trouble?
    Thanks a lot for helping me out of this!

    Folder
    mail \server name
    IMAPMail\server name
    Deleting the server name folders removes any residual mail for an account.
    Note deleting such a folder for an active account is something of a disaster.
    see http://kb.mozillazine.org/Recovering_deleted_mail_accounts not what you ask, but explains folder naming a little

  • "Your Mac OS X start up disk has no more space available for application memory. To avoid problems with your computer, quit any applications you are not using. Closing windows and removing files from your start up disk will also help -  ????

    I am still having trouble with my iMac since I last spoke with you guys about 2 weeks ago. Sorry to take so long to get back to you (things were a little wonky around here). Anyway, I did try running in Safe Mode, as Bob suggested but I continued to have the same problems. Strangely, the original message did not reappear, and has not popped up since the first time I wrote about it. However, the computer is still showing all the same problems. It is running slow, stalling in the middle of games, Youtube etc. I'm getting really sick of seeing that spinning color wheel every time I turn it on. Any advice you can give will be greatly appreciated & thank you all for all the tips and advice with my first posting.
    JT

    Freeing Up Space on The Hard Drive
      1. See Lion/Mountain Lion's Storage Display.
      2. You can remove data from your Home folder except for the /Home/Library/ folder.
      3. Visit The XLab FAQs and read the FAQ on freeing up space on your hard drive.
      4. Also see Freeing space on your Mac OS X startup disk.
      5. See Where did my Disk Space go?.
      6. See The Storage Display.
    You must Empty the Trash in order to recover the space they occupied on the hard drive.
    You should consider replacing the drive with a larger one. Check out OWC for drives, tutorials, and toolkits.
    Try using OmniDiskSweeper 1.8 or GrandPerspective to search your drive for large files and where they are located.

  • Apple (Unix) equivalent to a Windows "bat" file

    Good day,
    I have just solved a problem (thanks to someone on this forum) and written a small file to start the application.
    However, I wondering if there are some "simple" rules to write an equivalent of the Windows (DOS) bat file. I would like just to click on a file and let it run.
    Thanks.
    Kevin

    The DOS .BAT file was an attempt to bring to MS-DOS something like the idea of the UNIX script.
    In general, UNIX permits you to make a text file with commands in it and run it by simply flagging the text file as executable (rather than give it a specific suffix). This is how OS X does it. However, OS X adds the feature that if you give the file the suffix '.command', Finder will run Terminal.app to execute it (similar to how BAT files work in Windows).
    Unlike MS-DOS, however, UNIX (and OS X) permits you to specify what interpreter is used for the script. An interpreter is a program that reads in text from a file and does something with it. This is how languages like PERL and Python work.
    In UNIX, you can specify which interpreter to use by making the first line in the text file one that begins with '#!' followed by the path to the interpreter. For example, if your text file contains a script writtein the in the PERL language, it would look like this:
    #!/usr/bin/perl
    print "Hello World
    ... the UNIX shell is an intepreter too:
    #!/bin/sh
    echo Hello World
    For your script to run from the UNIX command line (Terminal.app), you need to set the executable flag of the file. For example, if your script is called 'myscript', then you'd type:
    chmod u+x myscript
    ... and you can execute it like so:
    ./myscript
    In fact, there are several different scripting languages provided with OS X for you to use: PERL, Python, Ruby, PHP, Bash, etc. Each has it's own strengths and complexities.

  • Bat file for hide System Drive

    I want to create and Bat file that will invisible my system drive. Kindly help how can i create this batch file.
    In my system having C, D,E,F,G, I drive and i want all drive hide.
    Nirmal Singh IT Administrator

    You can achive with GP's, However this also can be also achived from editing the Registry key's...
    What you can do is Just export the Registry by doing this
    http://tipsandhakcs.blogspot.com/2008/04/how-to-hide-computer-drives-in-windows.html artical.
    and then you can create a batch file to add this registry key on target systems. You can follow this artical for how to use
    http://support.microsoft.com/kb/310516 
    a sample batch exaple
    regedit.exe /s <var>path of .reg file</var>
    SCCM This posting is provided "AS IS" with no warranties or guarantees, and confers no rights. |Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually
    answer your question. This can be beneficial to other community members reading the thread.
    Unfortunately that key is blocked if attached to a domain.  Group POlicy takes ownership and set the user account to read only.
    IN a workgroup tis will wok as long as teh machine has never been joined to a domain.  When unjoining the policy key does not get reset.
    The link to blog post goes to a site that has been hacked.  It immediately redirects to another site.  You can stay on the page by disabling JavaScript temporarily.
    The site seems to redirect to a number of sites and quickly downloads a bunch of things then stays on the following page:
    http://bodisparking.com/deniedltd.com?bl=js
    jv

Maybe you are looking for