How to use a batch file to ...

Every time I go winlogo + R, cmd. I have to do two things quick religiously which get to be a pain. I am wondering if there is any way to set these properties to be remembered staticly or as a "last used" option of some sort.
I first of course have to navigate dos to the correct directory with cd <folder or folders> and secondly I have to 'reteach' the computer where my java compiler is installed with
cd desktop\documents\java\game
set path=%path%;C:\sun\sdk\jdk\binHow can I set these as default attributes for anytime I open cmd?
Is it possible using a .bat to set these as the default for only when i run the .bat and not every occasion?

nunnbt473 wrote:
Ok when I run the cmd.exe with admin privileges and use "set path=%path%;C:\sun\sdk\jdk\bin" my java files will compile correctly. Why are these settings not saved on exit though?Because they apply only to that command shell.
If you want to set your PATH variable permanently, you need to do it via the control panel. On my XP box, it's Start --> Settings --> Control Panel --> System --> Advanced --> Environment Variables.

Similar Messages

  • How to edit a line in a file using a batch file??????

    Basically i want to edit one line in a properties file, using a batch file, Here is what it says
    #Minecraft server properties
    #Tue Feb 22 15:58:36 PST 2011
    level-name=world2
    hellworld=false
    spawn-monsters=true
    online-mode=false
    spawn-animals=true
    max-players=5
    server-ip=5.196.238.77
    pvp=true
    server-port=25565
    white-list=false
    The IP address needs to be changed, i have a hamachi server and a server for home but i need to change this to my ip address on my computer wich is 192.168.1.74. This needs to be changed back and forth so how can i make a batch that just runs and then done its been changed.

    There are no .bat files in a Unix environment
    #!/usr/bin/env bash
    export NEW_IP=192.168.1.74
    perl -ni -e '
    s/d.d+.d+.d/$ENV{"NEW_IP"}/;
    print;
    ' yourpropertiesfile
    Make sure you change the file's protections so they are executable
    chmod +x nameof_yourscript
    There are other ways to do this, I just choose a perl script within a bash script. You could do it all with a bash script, you could use awk, you could use sed, you could use python, ruby, etc...

  • Help, how to install jvm and set the classpath using a batch file

    hello,
    i have created my java application and now have to create an installable / batch file which will install the JVM on the users machine and also the java packages such as javamail and the class files that i have created . it also has to set the classpath.
    i would like to know if anyone can tell me how to go about iti.e. how can i install the JVM using a batch file and then place the javamial packages etc in the apropriate directory .
    or is it advisable to explain it to the user how to go about it in tht user manual.
    and would also like to know that if i install the JVM will the path for the java.exe be set
    or will i have to set the path explicitly from the "batch file" so that the user can run the application without and problem just by running the java command followed by filename from the command prompt.

    hi,
    I have windows and I use it.
    The only problem with the free edition is that you can only create 1 launcher and that during the installation you get 1 popup showing that the installer was created with an unregistered version.
    Stijn

  • HOw to create a Batch file for java application and whats the use of this ?

    HI,
    How to create a Batch file for java application ?
    And whats the use of creating batch file ?
    Thanks in advance

    First of all, you're OT.
    Second, you can find this everywhere in the net.
    If you got a manifest declaring main class (an classpath if needed), just create a file named whatever.bat, within same directory of jar file, containing:
    javaw -jar ./WhateverTheNameOfYourJarIs.jar %*By the way, assuming a Windows OS, you can just double click the jar file (no batch is needed).
    Otherwise use:
    javaw -cp listOfJarsAndDirectoriesSeparedBySemiColon country/company/application/package/className %*Where 'country/company/application/package/' just stands for a package path using '/' as separator instead of '.'
    Don't specify the .class extension.
    Javaw only works on Windows (you asked for batch, I assumed .BAT, no .sh), in Linux please use java.exe (path may be needed, Windows doesn't need it 'cause java's executables are copied to system32 folder in order to be always available, see PATH environment variable if you don't know what I'm talking about) and use ':' as classpath (cp) separator.
    The '%***' tail is there in order to pass all parameters, it only works on Windows, refer to your shell docs for other OSs (something like $* may work).
    This way you have a command you can call to launch your code (instead of opening NetBeans just to see your app working). You could schedule tasks on it or just call it in any command prompt (hope you know what it is 'cause there have been people in this very same forum with no clue about it, if not just hold the 'Windows button' and press 'R', then type 'cmd' and run it).
    Finally add dukes and give 'hem away.
    Bye.

  • How to execute a batch file on different remote server using TFS Build

    I have a build server and have 2 web servers. I am deploying using TFS Builds. Now, I have a requirement to execute a batch file which is kept on these 2 web servers. i.e. C:\MyBatch\CreateMe.bat
    After my build is successful, I need to execute this batch from the build server.
    Note, I cannot make any shared folder.

    Hi Sameer, 
    Thanks for your post.
    What’s the version of your TFS?
    How do you deploy solution using TFS Build, run MSBuild deploy command or using Release Management?
    That C:\MyBatch\CreateMe.bat file stay on your two web server machines separately? 
    If you want execute this bat file on your two web server machines separately using build process template, you need configure your web server machine as build agent, then add the InvokeProcess activity in build process template to run the bat file on build
    agent machine after build, please refer to Hari’s answer reply in this post:
    https://social.msdn.microsoft.com/Forums/vstudio/en-US/b8bcb19f-1296-441c-8356-e701b949445a/tfs-2010-how-to-execute-a-batch-file-after-build?forum=tfsbuild.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How to create a Batch file for java application  ?

    HI,
    How to create a Batch file for java application ?
    And whats the use of creating batch file ?
    Thanks in advance

    [http://static.springsource.org/spring-batch/]
    Assuming you want to develop a batch application rather than actually just create a .bat file ..

  • How to use multiple video files??

    hi all,
    i am using flex 4 ...
    now i have designed video player..
    i used single flv file for execution..
    how to use more flv files in tis program???
    i have included program also..
    can any one reply for this...
    thanks in advance...
    regards,
    saran r
    video.mxml:
    <?xml version="1.0" encoding="utf-8"?>
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                   xmlns:s="library://ns.adobe.com/flex/spark"
                   xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600" creationComplete="init()" height="700" >
        <fx:Declarations>
            <!-- Place non-visual elements (e.g., services, value objects) here -->
        </fx:Declarations>
        <fx:Script>
            <![CDATA[
                import mx.core.UIComponent;
                import flash.events.NetStatusEvent;
                import flash.media.Video;
                import flash.net.NetConnection;
                import flash.net.NetStream;
                private var nc:NetConnection;
                private var stream:NetStream;
                public var videoDuration:Number;
                public var nsClient:Object = new Object();
                private var videoComp:Video = new Video();
                private var meta:Object = new Object();
                private var timer:Timer = new Timer(100);
                private var uiComp:UIComponent = new UIComponent();
                private function init():void
                    nc = new NetConnection();
                    nc.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
                    nc.connect("rtmp://localhost/saran");                 
                    this.addElement(uiComp);
                    uiComp.addChild(videoComp);
                    timer.addEventListener(TimerEvent.TIMER,timerHandler);
                    timer.start();
                private function netStatusHandler(event:NetStatusEvent):void
                    trace("Code ===>>>    "+event.info.code);
                    if(event.info.code == "NetConnection.Connect.Success")
                        connectStream(nc);
                private function connectStream(nc:NetConnection):void {
                    stream = new NetStream(nc);
                    videoComp.attachNetStream(stream);
                    stream.play("Terminator")
                    // stream.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
                    stream.client = nsClient//new CustomClient();
                    nsClient.onMetaData = metadataHandler;
                    trace("stream ===>>>    "+stream.currentFPS);
                    //responder = new Responder(onResult);
                    // nc.call("getStreamLength", responder, "bikes" );
                private function metadataHandler(metadataObj:Object):void
                    meta = metadataObj;
                    videoComp.width = metadataObj.width;
                    videoComp.height = metadataObj.height;
                    //positionBar.move(videoComp.x, ((videoComp.y + videoComp.height)+20));
                    //positionBar.width = videoComp.width;
                    trace("Duration ====>>>>   "+meta.duration);
                private function timerHandler(event:TimerEvent):void
                    //trace("Timer called.........."+stream.time);
                    //positionBar.setProgress(stream.time, meta.duration);
            ]]>
        </fx:Script>
    </s:Application>

    I have the same question but I am using two pc's

  • How to use a key file in the FTP Task using and SSL connection

    In the past I have used this code to set the FTP pass word in an FTP component task in SSIS.
    Does anyone know how to use a Key file in an SSL connection to download a file from an FTP site?  If not can you tell me where I can get the C# code examples to learn how to create a script task or if there is another way in SSIS to download large files
    from an SSL FTP site?  Thank you for any help offered.
    public void Main()
    ConnectionManager FTPConn;
    FTPConn = Dts.Connections["FTPServer"];
    FTPConn.Properties["ServerPassword"].SetValue(FTPConn, Dts.Variables["FTPPassword"].Value);
    Dts.TaskResult = (int)ScriptResults.Success;
    Antonio

    You can use SFTP for this.
    This is a way of implementing SFTP in SSIS using standard tasks 
    http://visakhm.blogspot.in/2012/12/implementing-dynamic-secure-ftp-process.html
    also see
    http://blog.goanywheremft.com/2011/10/20/sftp-ftps-secure-ftp-transfers/
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • How to run a batch file as windows Nt service

    Hi friends
    I want to know how to run a batch file as windows NT service.
    I got some information in the following link
    http://support.microsoft.com/kb/q243486/
    I tried it but i want to know what we need to include in Autoexnt.bat
    And one thing i need Instexnt.exe file. I cannot find tht file.
    Please search tht file and send me tht file or else send the link in which this file is present
    Please give me reply fast.its very urgent.
    Thanks in advance.

    Hi,
    My aim is to run a MS-DOS Batch file, that I created to run a Java Prgram.
    I need to call the Batch File from the Oracle Procedure, Also I may need to change the content of the Batch File (Argument to the Java JAR File ).
    I can keep the JAR FIle either in the Oracle Server or in the Application Server.
    The Java program is to convert XML Format FIle to PDF and MS Word format.
    Oracle Version : 10g 2.0.1.0.
    Thanks in advance
    Rizly

  • How to run a batch file

    Hi,
    How to run a batch file from Oracle. Is it possible directly from PLSQl, or should I write the java code.
    Oracle Version: 10g 2.0.1.0.
    Thanks in advance
    Rizly

    Hi,
    My aim is to run a MS-DOS Batch file, that I created to run a Java Prgram.
    I need to call the Batch File from the Oracle Procedure, Also I may need to change the content of the Batch File (Argument to the Java JAR File ).
    I can keep the JAR FIle either in the Oracle Server or in the Application Server.
    The Java program is to convert XML Format FIle to PDF and MS Word format.
    Oracle Version : 10g 2.0.1.0.
    Thanks in advance
    Rizly

  • How to use my as3 file in flex

    hi, I am new in flex and want to divert into flex. How to  use my as3 file into flex. Is there any sample tutor . so, that I could learn fast.

    Please clarify. Is this .as file a class you previously used as a complonentcomponent you now wish to use as the main application?
    If the .as file just has variables and functions you wish to access from your Flex app, use:
    include "subfolder1/subfolder2/etc/MyASFile.as";
    If you want to use classes from the file, do this:
    import subfolder1.subfolder2.etc.MyClassName;
    If this post answers your question or helps, please mark it as such.
    Greg Lafrance - Flex 2 and 3 ACE certified
    www.ChikaraDev.com
    Flex / AIR Development, Training, and Support Services

  • How to run the batch files

    Hi Experts,
    I am trying to implement automatic cache purging every day at specified time and i created txt file with SApurge All cache() and created bat file with nqcmd -q Analyticsweb -u username -p password -s (txt file location).
    Now i want to run this bat file daily at specified time with out executing manually may i know how to run the batch file at specified time .
    Thanks,

    There is task type as command in workflow manager if you want you can go for that during the load
    nqcmd -d "AnalyticsWeb" -u Administrator -p Administrator -s "D:\PowerCenter8.1.1\server\infa_shared\SrcFiles\1_BIPurgeCache.txt"
    Check these urls
    http://docs.oracle.com/cd/E12103_01/books/AnySched/AnySched_Scripts3.html
    http://deliverbi.blogspot.com/2011/12/purge-all-cache-from-dashboard.html

  • How to stop a batch file

    Hello everyone!
    I need your help
    I have a batch that runs during a power failure. The purpose of this batch file is to gracefully shut down my Database before my backup battery shuts down the system. The batch is bretty simple
    name: onbattery.bat
    code---
    <pre>
    timeout /t 100
    clcontrol /system idle
    </pre>
    The problem I have is that if the power comes back on before the countdown is finished, i want onbattery.bat to completely stop, so that i avoid turning off my database.
    I have been doing much research today and I can't seem to find a command that cancels a batch file. Is this possible?
    I have a second batch file I created that turns my DB back (offbattery.bat) on but it would be great if I could, at the begining of that batch say "first cancel any instance of 'onbattery.bat', now turn on my DB.
    Just to be clear, here is what my offbatter.bat file looks like
    <pre>
    timeout /t 100
    clcontrol /system FOH
    </pre>
    Any help would be greatly appreciated.

    i hear what you all are saying. But the problem is that these APC were recently bought and now we just have to "make them work"  I am not using APC Powerchute software since these battries are technically for small home office work.  But I am using
    a 3rd party program APCUPSD that actually works great. The software recognizes where there is a power outage and goes to its onbattery command.  As long as i create a script that is called the same thing as the event the the APC software batch file understands,
    it will run it.
    I just need to be able to create my offbattery.bat file to say the following:
    First kill/cancel onbattery.bat
    Next Turn on my database
    I want to kill the onbattery.bat script to stop it from turning off my DB.  This is in case the site looses power for less than 9 min.  I wast the DB to stay on without interrupting normal business for my restaurant.
    Is there a way to use another batch file to cancel an already running batch file?

  • How to run a batch file clicking a button?

    Hi All,
    Can you tell me anyone how to run a batch file clicking a button? And also the progress bar showing the progress.
    Arif

    As said: write the insert statement like above (of course replace the databaselink, column and table names with your own) in a stored procedure and call this procedure in the WHEN-BUTTON-PRESSED Trigger.
    As for the progress bar: how many records are you processing and how is the network connection between your database server? As above method is rather fast it might take just a few seconds and you could spare you the progress bar (this might be a little tricky to implement).
    cheers

  • How to run a batch file using tigger....

    Hi, i am trying run a batch file using a trigger on a table.
    say i have a table XYZ(col_1 varchar2 primary key, col_2 varchar2)
    the values of col_2 keeps changing and col_1 are constant
    whenever the value of col_2 in any row changes from "on" to "off" i want to run a batch file C:\Users\ABC\Desktop\test.bat
    i did some searching but couldn't find any solution. Thanks in advance
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
    sorry wrong foum to post.
    will post in the correct one
    how to run batch file using trigger?

    Hallo,
    welcome to the forum.
    This is the forum for the tool {forum:id=260}. Your question should be placed in {forum:id=75} or {forum:id=61}.
    When you post your question there please provide additional information like db version, what kind of trigger you want to use, how you want to prevent the execution when the transaction is rolled back... {message:id=9360002}
    Regards
    Marcus

Maybe you are looking for

  • Simple math and a variable in an mc instance name

    i have several movie clips with instance names in the format of screened1, screened2, screened3, and so on. i am trying to reference a movie clip as shown below, but it's not working. what am i doing wrong? how do i fix it? this.screened[numOfItems-8

  • Re: Sometimes my Satellite P300 forgets to load video driver

    My laptop (Satellite P300) sometimes "forgets" at startup to load the videodriver. So the resolution is default in the startup screen of Windows. Doesn't matter which Windows version I have and all the drivers are up-to-date. When I restart mostly th

  • Can't pair apple remote

    Hi!, I need some help. I've been trying to pair my apple remote (6 buttons) and I just can't do it. The apple remote is from an old iMac that is not even here and I'm trying to pair it with a brand new (iMac 14,1 ME086E/A, model: A1418). I've been lo

  • No partner profiles (message control) maintained.

    Hi Friends, I have created a PO but getting error message in output type that No partner profiles (message control) maintained. Message no. B1127 Diagnosis No IDOC partner profiles have been created for the message control for for application EF, con

  • Definition of Inactive profit center

    Hi, can anyone explain me the meaning of Inactive Profit center. By making incative, the posting goes through and if i lock, the postings are blocked. so what is the use of Inactive:Change, which come when I change the status.. Thanks.