Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

batch files

Options
  • 06-04-2005 3:05pm
    #1
    Closed Accounts Posts: 10


    hi, i have a stand alone java application that calls a number of simple batch fille.The program runs fine and executes the batch files on my own pc(XP) but when i bring it to one of my labs PC(2000) it doesnt call any of the batch files.
    Any help would be very much appreciated.
    thanks


Comments

  • Closed Accounts Posts: 1,746 ✭✭✭0utshined


    Can you show us the code that is calling the batch files? What is the path to the files on your home PC? What is the path to the files on your college PC? Do the batch files display a command box? Do you need write access to a drive on the PC?


  • Registered Users Posts: 21,264 ✭✭✭✭Hobbes


    Are the batch files on the other machine? Is it calling them using the PATH ? If so are they on the path?


  • Closed Accounts Posts: 10 gintreach


    ive actually narrowed the problem down alot.all batch files are being called automatically from java in my lab.There is just a problem with one, one of the batch files is called but doesnt complete its task.here is the code

    cd c:\Documents and Settings\0141461\Desktop
    mkdir Backup
    cd c:\Documents and Settings\0141461\Desktop\Backup
    XCOPY "c:\mysql\data" "c:\Documents and Settings\0141461\Desktop\Backup" /s

    it creates the folder but doesnt do the copying part.However if you double click on the batch itself(ie call it manually) it runs perfect...creates the folder and copies in all the files...

    very confusing.
    Thanks for your help so far.


  • Closed Accounts Posts: 1,746 ✭✭✭0utshined


    Sounds strange,

    I haven't done Java in a number of years so I'll just give you some basic suggestions

    - Is the batch file location and name the same in the program as on the PC?
    - Is it the same version of batch file?
    - Is the folder xcopy is in, in the Java classpath? (don't know if this matters)
    - What are the permissions on the "c:\Documents and Settings\0141461\Desktop\" folder? Are these the same as the "c:\mysql\data" folder?

    Best of luck.


  • Registered Users Posts: 2,426 ✭✭✭ressem


    Off the topic, but shouldn't you consider mysqldump --add-locks --all-databases instead of xcopy, if your data is worth backing up?


  • Advertisement
  • Registered Users Posts: 4,003 ✭✭✭rsynnott


    gintreach wrote:
    ive actually narrowed the problem down alot.all batch files are being called automatically from java in my lab.There is just a problem with one, one of the batch files is called but doesnt complete its task.here is the code

    cd c:\Documents and Settings\0141461\Desktop
    mkdir Backup
    cd c:\Documents and Settings\0141461\Desktop\Backup
    XCOPY "c:\mysql\data" "c:\Documents and Settings\0141461\Desktop\Backup" /s

    it creates the folder but doesnt do the copying part.However if you double click on the batch itself(ie call it manually) it runs perfect...creates the folder and copies in all the files...

    very confusing.
    Thanks for your help so far.

    This is not a good way to back up MySQL data. The format of those files change as new versions come out, and if you happen to copy it while it's being written to, your backup will be less than entirely useful. Use mysqldump instead.


Advertisement