Help with writing a batch file

Hi :
does anyone know anyplace online that I can get help in writing batch files?? I have never worked much with batch files before....
any help is greatly appreciated
thnx

I suppose, since you're in a Java forum, you need batch files to load java applications.
If you use windows :
go to ms console (start/run/"cmd")
type edit mybatch.bat
write your command to load a java application, something like
java myclass.class
save and exit.
Be sure the bat file and the class are in the same folder.
And make certain you've set the classpath, and path variables correctly.
If this was what you needed and you need more help just ask.
(In this case it could be better to make executable jars)
If you wanted to know about linux batches, it works pretty the same way.

Similar Messages

  • Help with writing, reading a file...

    I'm writing a program that writes a number to a file and then reads it again each time it is loaded. It's like a counter, the number starts out being 0, then when the program is run again the number will be two, and so on and so on. I've never been good with writing incrementer type things and files, so could you help me out? Remember, the program writes a single number to the file, and then adds one to that number each time the program is run, so it starts at zero and goes up by one each time it is run.
    -Thanks... I just came back from vacation and my Java skills are somewhat lacking :P

    open old file -> get the number -> create a new file -> write new number

  • Help with calling a batch file from projector

    Hi all.  I have been asking a fair number of questions here recently and have been very pleased with the responses, so here is one more for you.  Hopefully I can get another solution. :]
    I have a flash project acting like a menu and being published as an .exe (projector).  In this file, I have a button with the following code:
    button1.onRelease=function(){
         fscommand("exec", "openfiles.bat");
    I have an fscommand folder (in the same directory as my flash file) which contains the openfiles.bat, with one line:
    start myfile.txt
    myfile.txt is also located in the fscommand folder.  When I simply click on this batch file and run it, the text file opens as it should.  However, when I click the button in my flash file, a command prompt window flashes too quickly to see with some sort of error message.  It says something about not finding a certain directory and defaulting to the windows directory.  I'm assuming it cannot find either my batch file or my text file.  I am under the impression that as long as everything is in the fscommand folder it should work properly.  Can anyone offer me advice?  Thanks!

    http://www.northcode.com/blog.php/2007/08/14/FSCommand-EXEC-is-Broken-in-Flash-CS3

  • Need help with writing to a file

    I am writing a program that is a file sharing program where i read in bytes from a socket in a BufferedReader into a char[]. Then i want to write to a file using FileOutputStream which only lets me write with a byte[]. Is there a way to read in the info into a byte[] rather a char[]?

    may be this code helps
    import java.io.*;
    public class cp
            public static void main(String args[])
                    try
                    File my=new File("source.txt");
                    FileReader fr=new FileReader(my);
                    BufferedReader br=new BufferedReader(fr);
                    String a;
                    FileWriter fw=new FileWriter(args[5]);
                    while((a=br.readLine())!=null)
                            System.out.println(a);
    fw.write(a);
    fw.close();
                    }catch(Exception e){}

  • Help with writing to a file

    First off...I'm just a student so please bear with me...
    I'm having problems with the following bit of code. I don't seem to be understanding the correct way to write to a file. It's not a complete program and my drop down box isn't set up to write yet...but I'm just trying to get SOMETHING as output to the file. Any help is appreciated! Here's my code:
    Mid-Term Test
    Programmer: Abraham Violett
    Date: 8-12-04
    Filename: MowersInc.java
    Purpose: This will be a data entry and retrival system
    for a
    small lawn mowing company.
    import java.io.*;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class MowersInc extends JFrame implements ActionListener
    JLabel blankLabel = new JLabel("");
    JLabel titleLabel = new JLabel(" Mowers Incorporated");
    JLabel firstNameLabel = new JLabel("First Name:");
    JTextField firstNameTextField = new JTextField(15);
    JTextField lastNameTextField = new JTextField(15);
    JLabel lastNameLabel = new JLabel("Last Name:");
    JComboBox lawnSizeCombo = new JComboBox();
    JButton submitInfoButton = new JButton("Submit");
    JButton clearInfoButton = new JButton("Clear");
    DataOutputStream output;
    public MowersInc()
    super("Mowers Inc.");
    try
    output = new DataOutputStream(new FileOutputStream("customers.dat"));
    catch(IOException io)
    JOptionPane.showMessageDialog(null, "Could not create storage location.", "Error", JOptionPane.INFORMATION_MESSAGE);
    System.exit(1);
    setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    public void actionPerformed(ActionEvent e)
    String arg = e.getActionCommand();
    int fee;
    if (e.getSource() == lawnSizeCombo)
    switch (lawnSizeCombo.getSelectedIndex())
    case 0:
    fee = 50;
    break;
    case 1:
    fee = 75;
    break;
    default:
    break;
    if(arg == "Submit")
    try
    output.writeUTF(firstNameLabel.getText());
    output.writeUTF(lastNameLabel.getText());
    catch(IOException io)
    JOptionPane.showMessageDialog(null, "Could not create storage location.", "Error", JOptionPane.INFORMATION_MESSAGE);
    System.exit(1);
    public Container createContentPane()
    lawnSizeCombo.addItem("Please select Lawn Size...");
    lawnSizeCombo.addItem("Lawn less than 1000 sq/ft.");
    lawnSizeCombo.addItem("Lawn more than 1000 sq/ft.");
    lawnSizeCombo.addActionListener(this);
    JPanel mainPanel = new JPanel();
    mainPanel.add(titleLabel);
    mainPanel.add(blankLabel);
    mainPanel.add(firstNameLabel);
    mainPanel.add(firstNameTextField);
    mainPanel.add(lastNameLabel);
    mainPanel.add(lastNameTextField);
    mainPanel.add(lawnSizeCombo);
    mainPanel.add(blankLabel);
    mainPanel.add(submitInfoButton);
    mainPanel.add(clearInfoButton);
    lawnSizeCombo.setToolTipText("Select the appropriate lawn size from this list.");
    mainPanel.setLayout(new FlowLayout());
    //mainPanel.setLayout(new GridLayout(6, 2, 10, 10));
    return mainPanel;
    public static void main(String args[])
    MowersInc test = new MowersInc();
    test.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    test.setContentPane(test.createContentPane());
    test.setSize(200, 215);
    test.setVisible(true);
    //lawnSize.addItem("Less than 1000 sqr/ft.");
    //lawnSize.addItem("More than 1000 sqr/ft.");
    }

    Use a program development method called Stepwise
    Refinement. Start out with a small working program.
    Then expand it little by little and in each step make
    sure that it works and you understand why. Very soon
    you have a big working program. Try it, it always
    works -:)Pay heed to UlrikaJ -:) sweety's advice, you'll be happy! ;-)
    UlrikaJ cutie would you like to go out with me someday? : )

  • Required help with writing to a file.. urgent plz help

    Hello Everyone, 
                             I am using the following code to write data to a particular file.. 
    I have 2 wfms, pressure and torque, the pressure is a simple one...
    THe torque is bit complex, the operator has to press the "Start/Stop Torque DAQ" button and then select a filename... Next, he has to press the "Run/Stop Test"
    button to finish 1 set of test and then write to the next available file name without pressing anything else... 
    I tried connecting an OR gate to the enable/reset ports, but it didn't work... Can anyone please suggest me how to do this??
    Now on LabVIEW 10.0 on Win7
    Attachments:
    RCD_v002.vi ‏129 KB

    Hh Crack Jack,
    Try this...
    <<Kudos are welcome>>
    ELECTRO SAM
    For God so loved the world that he gave his one and only Son, that whoever believes in him shall not perish but have eternal life.
    - John 3:16

  • Help with writing .bashrc file

    I would like help with writing a .bashrc file.
    The only thing I want right now is colored output and slashes for directories like what "ls -GF" does -- for each new terminal window.
    Can you guys give me a hand?
    Running Mac OS 10.4.6. Bash is default shell.
    Thanks.

    Hi Paul,
       You can get Apple's "ls" command to always output color with the following in your .bashrc:
    export CLICOLOR=""
    You can have an effect on the colors used with settings like the following:
    export LSCOLORS="gxfxcxdxbxegedabafacad"
       I have a color prompt in my bash startup scripts, bashrc.tgz. If you unpack the tarball in the root of your home directory, the files will be put in a ~/Library/init/bash directory. The file named "prompt" sets the color prompt string.
    Gary
    ~~~~
       I know you think you thought you knew what you
       thought I said, but I'm not sure you understood what
       you thought I meant.

  • Help with writing and retrieving data from a table field with type "LCHR"

    Hi Experts,
    I need help with writing and reading data from a database table field which has a type of "LCHR". I have given an example of the original code but don't know what to change it to in order to fix it and still read in the original data that's stored in the LCHR field.
    Basically we have two Function modules, one that saves list data to a database table and one that reads in this data. Both Function modules have an identicle table which has an array of fields from type INT4, CHAR, and type P. The INT4 field is the first one.
    Incidentally this worked in the 4.7 non-unicode system but is now dumping in the new ECC6 Unicode system.
    Thanks in advance,
    C
    SAVING THE LIST DATA TO DB
    DATA: L_WA(800).
    LOOP AT T_TAB into L_WA.
    ZDBTAB-DATALEN = STRLEN( L_WA ).
    MOVE: L_WA to ZDBTAB-RAWDATA.
    ZDBTAB-LINENUM = SY-TABIX.
    INSERT ZDBTAB.
    READING THE DATA FROM DB
    DATA: BEGIN OF T_DATA,
                 SEQNR type ZDBTAB-LINENUM,
                 DATA type ZDBTAB-RAWDATA,
               END OF T_TAB.
    Select the data.
    SELECT linenum rawdata from ZDBTAB into table T_DATA
         WHERE repid = w_repname
         AND rundate = w_rundate
         ORDER BY linenum.
    Populate calling Internal Table.
    LOOP AT T-DATA.
    APPEND T_DATA to T_TAB.
    ENDLOOP.

    Hi Anuj,
    The unicode flag is active.
    When I run our report and then to try and save the list data a dump is happening at the following point
    LOOP AT T_TAB into L_WA.
    As I say, T_TAB consists of different fields and field types whereas L_WA is CHAR 800. The dump mentions UC_OBJECTS_NOT_CONVERTIBLE
    When I try to load a saved list the dump is happening at the following point
    APPEND T_DATA-RAWDATA to T_TAB.
    T_DATA-RAWDATA is type LCHR and T_TAB consists of different fields and field types.
    In both examples the dumps mention UC_OBJECTS_NOT_CONVERTIBLE
    Regards
    C

  • Help with writing a formula

    Hi all,
    I am creating a report, and need help with writing a formula...
    I am creating a report that shows how many visits/touches our reps have made to various grade accounts. It is broken down by calendar week, and I currently have a weekly "goal" number set that the reps have to meet. That "goal" number increases each week to keep a running total. (example: week 1: 7, week 2: 14, week 3: 21)
    I have created some different formulas and one is this:
    SUM("Activity Metrics"."# of Activities" BY Date."Calendar Week")
    What this shows me is how many "visits" there are per calendar week to customers, however it show me the total for all reps per week.
    What I need is that total to show, but totaled for each rep individually.
    What I was trying is this:
    SUM("Activity Metrics"."# of Activities" BY Date."Calendar Week") BY Employee."Employee Name"
    But...I keep getting an error.
    Any suggestions?
    I have the reporting book by Lairson, and have been referring to it...but my brain at this point is fried.
    Thanks in advance for any help...(please forgive...I am new to OnDemand, and I am sure this is easy)

    Thanks for helping!
    I created this formula as a column: SUM ("Activity Metrics"."# of Activities" BY Date."Calendar Week"), it is called "total number of visits per week" and it shows the totaled number of visits that all the reps have done per calendar week. For example: Week 1: 10 visits, Week 2: 37 visits, Week 3: 20 visits.
    What I would like to do is take that column and break it down further, to show instead how many visits per week by sales rep there have been
    So what I was trying was to take the "total number of visits per week" (SUM ("Activity Metrics"."# of Activities" BY Date."Calendar Week")) and use "Activity Owner" (Employee."Employee Name") to break it down further.
    What I need to use is the total number of visits each rep has per calendar week.
    I think I am getting the error because you can't use "BY" twice in a formula?

  • Help with converting a Nero file

    I have previously converted a dvd insert designed with Nero into a pdf using adobe acrobat in order to send to someone else.  When I tried to do the same thing today with a new Nero designed insert the conversion wouldn't work.  The message said adobe didn't support the program that created the file.  Any ideas?

    thanks for your response.
    When I create a dvd insert or cd label etc using Nero the file extension is nct - nero cover template.  The printer wants the file as a pdf as he can't open Nero files.  I have version 9.3 of acrobat.
    Date: Mon, 18 Jan 2010 21:43:47 -0700
    From: [email protected]
    To: [email protected]
    Subject: help with converting a Nero file
    Nero is simply a CD/DVD burning application and should have no effect on the type of files that will eventually be on the CD/DVD.
    What type of files are you trying to convert and exactly how are you trying to convert them? Plus, it would help to know the version of Acrobat you are using.
    >

  • I had to put my computer by together without migration or time machine I NEED help with order of the files?

    I had to put my computer by together without migration or time machine I NEED help with order of the files?

    Hi, where are these other files exactly?

  • Help in writing to a file with newline facility

    I am using the RandomAccessFile class to write to a file.
    The content i am writing to the file is of the form
    KEY=VALUE.
    I am writing several key value pairs like this.
    Everytime I write a KEY=VALUE it should be in a new line.
    So, what should i do to write in a new line everytime.
    Please help.
    Thanks in advance.

    Well the square most likely is just a non-printable character. If you are on windows the line.separator is \r\n (0x13 and 0x10) some file editors show the \n as a "square" as the only expect a \r its just how you interpret the file.. you can't atually do anythign about it as it isn't "wrong" if you skip the \n some programs might not see it as a newline. If you add it some may display a square.. Its the great gift of different OS's using different line separators..
    HTH
    Lima

  • Help with utl_file (read/write file from local directory)

    Need help reading/writing file on local machine from plsql using 10.2 DB.
    I am trying to read/write a file from a local directory(laptop) without success.
    I have been able to read/write to the database server directory but can't write to directory on local machine.
    The utl_file_dir parm has been set to * and the db restarted but I can't get it to work... Here's the plsql statement.
    out_file := UTL_FILE.FOPEN ( 'C:\PLSQL', 'TEST.TXT', 'W' ,32767);
    Whenever I run it continues to write to c:\PLSQL dir on the database server. Have looked at the "Directory" object and created MY_DIR = C:\PLSQL but it writes to the db server.
    Running 10.2 on a remote windows server, running PLSQL using sql*navigator.
    Thanks in advance for your help..

    I don't see how you expect the server to be able to see your laptop across the network, hack into it and start writing files. Even if it could, what if there is more than one laptop with a C: drive? How would it know which one to write to?
    Is there a shared drive on the server you can access via the laptop?

  • Help with creating a sql file that will capture any database table changes.

    We are in the process of creating DROP/Create tables, and using exp/imp data into the tables (the data is in flat files).
    Our client is bit curious to work with. They do the alterations to their database (change the layout, change the datatype, drops tables) without our knowing. This has created a hell lot of issues with us.
    Is there a way that we can create a sql script which can capture any table changes on the database, so that when the client trys to execute imp batch file, the sql file should first check to see if any changes are made. If made, then it should stop execution and give an error message.
    Any help/suggestions would be highly appreciable.
    Thanks,

    Just to clarify...
    1. DDL commands are like CREATE, DROP, ALTER. (These are different than DML commands - INSERT, UPDATE, DELETE).
    2. The DDL trigger is created at the database level, not on each table. You only need one DDL trigger.
    3. You can choose the DDL commands for which you want the trigger to fire (probably, you'll want CREATE, DROP, ALTER, at a minimum).
    4. The DDL trigger only fires when one of these DDL commands is run.
    Whether you have 50 tables or 50,000 tables is not significant to performance in this context.
    What's signficant is how often you'll be executing the DDL commands on which the trigger is set to fire and whether the DDL commands execute in acceptable time with the trigger in place.

  • Help with Could not load file or assembly 'msshrtmi' or one of its dependencies. An attempt was made to load a program with an incorrect format.

    This was all working yesterday, but this morning, I cannot run in the dev fabric, or even setting the website project as a startup project directly, I get the following error:
    Could not load file or assembly 'msshrtmi' or one of its dependencies. An attempt was made to load a program with an incorrect format.
    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
    Exception Details: System.BadImageFormatException: Could not load file or assembly 'msshrtmi' or one of its dependencies. An attempt was made to load a program with an incorrect format.
    Source Error:
    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
    Assembly Load Trace: The following information can be helpful to determine why the assembly 'msshrtmi' could not be loaded.
    === Pre-bind state information ===
    LOG: User = Andrew-VAIO\Andrew
    LOG: DisplayName = msshrtmi
    (Partial)
    WRN: Partial binding information was supplied for an assembly:
    WRN: Assembly Name: msshrtmi | Domain ID: 3
    WRN: A partial bind occurs when only part of the assembly display name is provided.
    WRN: This might result in the binder loading an incorrect assembly.
    WRN: It is recommended to provide a fully specified textual identity for the assembly,
    WRN: that consists of the simple name, version, culture, and public key token.
    WRN: See whitepaper http://go.microsoft.com/fwlink/?LinkId=109270 for more information and common solutions to this issue.
    LOG: Appbase = file:///C:/Users/Andrew/Desktop/Beko2011Azure/Website/
    LOG: Initial PrivatePath = C:\Users\Andrew\Desktop\Beko2011Azure\Website\bin
    Calling assembly : (Unknown).
    ===
    LOG: This bind starts in default load context.
    LOG: Using application configuration file: C:\Users\Andrew\Desktop\Beko2011Azure\Website\web.config
    LOG: Using host configuration file:
    LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
    LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
    LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files/root/cb955b02/eef106e2/msshrtmi.DLL.
    LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files/root/cb955b02/eef106e2/msshrtmi/msshrtmi.DLL.
    LOG: Attempting download of new URL file:///C:/Users/Andrew/Desktop/Beko2011Azure/Website/bin/msshrtmi.DLL.
    ERR: Failed to complete setup of assembly (hr = 0x8007000b). Probing terminated.
    Stack Trace:
    [BadImageFormatException: Could not load file or assembly 'msshrtmi' or one of its dependencies. An attempt was made to load a program with an incorrect format.]
    System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +0
    System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +39
    System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection, Boolean suppressSecurityChecks) +132
    System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +144
    System.Reflection.Assembly.Load(String assemblyString) +28
    System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +46
    [ConfigurationErrorsException: Could not load file or assembly 'msshrtmi' or one of its dependencies. An attempt was made to load a program with an incorrect format.]
    System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +618
    System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() +209
    System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai) +130
    System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig) +178
    System.Web.Compilation.BuildManager.GetPreStartInitMethodsFromReferencedAssemblies() +94
    System.Web.Compilation.BuildManager.CallPreStartInitMethods() +332
    System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +677
    [HttpException (0x80004005): Could not load file or assembly 'msshrtmi' or one of its dependencies. An attempt was made to load a program with an incorrect format.]
    System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +9079228
    System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +97
    System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +258
    Note that the dev machine is x64 Win7.
    I have not tried deploying this to staging since the issue started as I'm a bit nervous of touching the staging/live environment until this is solved.
    Removing the PlatformTarget element from the project file has no effect
    Removing the msshrtmi.dll file from the bin directory of the website project ends up with 
    'Could not load file or assembly 'Microsoft.WindowsFabric.Common, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified'
    I have used Git to revert to the last working build to no effect (But I don't have the obj/bin folders in GIT), but it has atleast reset the project files etc.
    If I return msshrtmi.dll to the bin folder and switch the model and website projects to x64 there is no change
    If I switch both to x86 then I get an error Could not load file or assembly 'BekoModel2011' or one of its dependencies. An attempt was made to load a program with an incorrect format.
    which is the model project - presumably because to run on my x64 machine I need the 64bit version?
    I really need to be able to debug and then publish some changes ASAP.
    Andrew

    Hi,
    Is it true that you're using IIS to host the application? Could you check whether the process is x64 or x86 one via task manager or config in IIS manager?
    http://blogs.msdn.com/b/rakkimk/archive/2007/11/03/iis7-running-32-bit-and-64-bit-asp-net-versions-at-the-same-time-on-different-worker-processes.aspx
    Allen Chen [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

Maybe you are looking for