.BAT FILE HELP!

Hi, I am using Leopard version 10.5.4 have been having trouble with .bat files. I understand that you have to rewrite the file as an applescript or shell file ( I think). Here is the script,
@echo off
COLOR 03
title 503 client
cd ClientFiles/
java -Xmx1200m client 0 live live highmem members english game0
pause
The file is opened in TextEdit just like all other .bat files. So basically I need help with what program and how to write the script so that I can open the program on my Mac.

So can you help me at all?
read the link I posted in my earlier thread about bash shell scripts. Get yourself a Mac OSX Unix book and learn to use the terminal application it compares to a DOS window but is way more powerful and functional.
if your using the terminal to lauch that java app using the one you quoted
cd ClientFiles/
java -Xmx1200m client 0 live live highmem members english game0
then to write a simple shell script you open the terminal application and use the following commands but the CD command must use the full path to the file eg /Users/yourname/ClientFiles
pico myscriptpress enter
paste the following into the terminal window
#!/bin/sh
cd /Users/yourname/ClientFiles
java -Xmx1200m client 0 live live highmem members english game0
Then press control +O folllowed by control +X
then make the script executable with the command
chmod +x myscript
now you have an executable script

Similar Messages

  • HELP:: Flash unable to open BAT file or PPT file

    HELP Please....
    I am using Flash MX.. my projector exe file doesnt seem to
    open/call
    "myppt.bat" file which calls a powerpoint (PPS) file after
    the animation is
    over. The bat file runs well when
    self executed but not from flash...
    I also installed the trial version of Flash 8 and seem to be
    having the same
    above problem.
    please help by providing a working solution.

    Use FlashJester JStart
    http://jstart.flashjester.com
    p.s Beware, a double posting is not seen too good..
    Regards
    FlashJester Support Team
    e. - [email protected]
    w. -
    http://www.flashjester.com
    There is a very fine line between "hobby" and
    "mental illness."

  • Can anyone help me rewrite a .bat file to work on my iMac?

    I need some help writing these .bat files so i can use them on my mac
    @echo off
    @title Dump
    set CLASSPATH=.;dist\Lithium.jar;dist\mina-core.jar;dist\slf4j-api.jar;dist\slf4j-j dk14.jar;dist\mysql-connector-java-bin.jar
    java -server -Dnet.sf.odinms.wzpath=wz/ tools.wztosql.DumpItems
    pause
    //new file
    @echo off
    @title Dump
    set CLASSPATH=.;dist\Lithium.jar;dist\mina-core.jar;dist\slf4j-api.jar;dist\slf4j-j dk14.jar;dist\mysql-connector-java-bin.jar;dist\bcprov-jdk16-145.jar
    java -server -Dnet.sf.odinms.wzpath=wz/ tools.wztosql.DumpMobSkills
    pause
    //new file
    @echo off
    @title Dump
    set CLASSPATH=.;dist\Lithium.jar;dist\mina-core.jar;dist\slf4j-api.jar;dist\slf4j-j dk14.jar;dist\mysql-connector-java-bin.jar;dist\bcprov-jdk16-145.jar
    java -server -Dnet.sf.odinms.wzpath=wz/ tools.wztosql.DumpQuests
    pause
    //new file
    @echo off
    @title Lithium Server Console
    set CLASSPATH=.;dist\Lithium.jar;dist\mina-core.jar;dist\slf4j-api.jar;dist\slf4j-j dk14.jar;dist\mysql-connector-java-bin.jar
    java -server -Dnet.sf.odinms.wzpath=wz/ server.Start
    pause
    Thank you very much, im sorry if i seem very ignorant by asking this, i just dont know applescript and im trying to get this done as fast as possible.

    Try the developer forums:
    https://discussions.apple.com/community/developer_forums

  • Need help pass in date parameter into bat file.

    Is it possible to schedule sql job to execute bat files and pass in date below.
    I want to take a system date and pass into the bat file below.  A Schedule Job will run on Monday at 9 P.M.
    I want to automate this process instead manually enter into the bat file.  Is that possible?
    Any suggestions is appreciate.  SQL 2012
    Thank you so much in advance.
    SQL Schedule job
    DECLARE @sMonday VARCHAR(25) = REPLACE(CONVERT(VARCHAR(10), GETDATE(), 1), '/', '')
    SET @sMonday = @sMonday + '_qa48_Clonedb'
    SELECT @sMonday
    --021315_qa48_Clonedb
    DECLARE @sPrevMonday VARCHAR(25) = CAST(REPLACE(CONVERT(CHAR(10), DATEADD(DAY, - (DATEPART(dw, GETDATE() ) - 1), GETDATE() ),1), '/', '') AS CHAR(6))
    SET @sPrevMonday= @sPrevMonday + '_qa48_Clonedb'
    SELECT @sPrevMonday
    --020815_qa48_Clonedb
    Result want:
    -- Testbatfile.bat
    REM 021615_qa48_Clonedb
    SET sToday = @sMonday        
    SET sPreviousWeek = @sPrevMonday
    SET sNumOfDay=07
    DiskMirror -l snapsrvcfdba n4brec01a -i privkey.ppk "snap rename sql32oltp_repl_dataf sqlsnap__brpRMSDVS050a__recent %sToday% "
    DiskMirror -l snapsrvcfdba n4brec01a -i privkey.ppk "snap rename sql32oltp_repl_logf  sqlsnap__brpRMSDVS050a__recent %sToday% "
    DiskMirror -l snapsrvcfdba l9ABC01d -i privkey.ppk "snap rename sql100oltp_repl_dataf %sPreviousWeek% sqlsnap__ABCPWSCVR050a__%sNumOfDay% "

    See
    https://sharminjahan625.wordpress.com/2013/08/30/384/
    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • Help! problem running .bat files in browser

    HI! Hope you can help me!
    I have a simple applet that runs .bat files and retrieves the resulting information into a text box.
    To run those files I use:
    Runtime rt = Runtime.getRuntime();
    Process processo=rt.exec("C:/po2PrtMonitor.bat 04600105 ope >C:/infoPrt.txt");
    in wich "04600105","ope" and ">C:/infoPrt.txt" are parameters that the .bat file is expecting. When the file is ran it saves the resulting information on a simple .txt file, that I later read by using:
    fichResposta = new FileInputStream(fichRespostaPath[0]);
    When I run my applet on JDeveolper 9.0.2.822 is works perfectly, the problem is when run it on the browser.
    On the browser the applet executes the file by opening a MS-DOS prompt and when it finishes executing the file, the prompt closes automatically and doesn't send the information into the .txt file.
    My .bat file is something like:
    jre -cp PrtSrv20.jar sibs.deswin.prt.PrtMonGateway 10.46.1.22 5003 %1 %2 %3
    where %1,2%,3% are the above parameters given by the applet when the file is ran.
    If I run it on JDeveloper I get:
    C:\>jre -cp PrtSrv20.jar sibs.deswin.prt.PrtMonGateway 10.46.1.22 5003 04600105 ope
    PRTSES=04600105 HDR=0460010000000005 STA=OPENED TRF=ACTIVE TRP=CONN ILTS=15 Long postings are being truncated to ~1 kB at this time.

    Here is what is missing:
    ILT=0 MSQ=388 HDR=04.60.01.00.00.00.00.05.41.00.01.84. CMD=STRT-TRF
    When the applet is run on the IE broser what I get is simply:
    jre -cp PrtSrv20.jar sibs.deswin.prt.PrtMonGateway 10.46.1.22 5003 04601005 ope
    I have no idea as to what the problem might be! Do native methods work differently on the browser?! Could it be a problem on the deployment? A library not included on the deployment profile? Suggestions are very welcome.
    Hugo Rosas

  • Bat files from java application..its urgent pls help me

    hi
    My java application tries to execute the bat file, the code followes
    Runtime runs = Runtime.getRuntime();
              runs.exec("e:/customisation/test.bat");
    The bat file contains commands to copy files from one folder to another
    and some dos commands, but the commands are not executing. If i tried the bat file with some exe's like notepad its working well, but not working with dos commands.
    thanks in advance
    nisam

    Hi
    Your batch file will be working actually. But no output will be seen in the console window.
    For example I had created a batch file with the folowing code
    echo This is test
    copy test.bat test1.bat
    pause
    Even though I can't see the messages in the console, it executed when called using
    Runtime runs = Runtime.getRuntime();
    runs.exec("hi.bat");
    where hi.bat contains the above code.
    If you want to see the output messages also in the console, you have to redirect the outputstream to the current console. One such class this does is available somewhere in Java(I don't exactly remember :-( ). I think it is StreamPluginThread.java
    Regards

  • Using a .bat file to use Values in Registry from another Registry

    I recently starting working in an IT Department and for years my superiors/co-workers have always had a piece of software called "cyt.exe".
    When ever I logged in someones computer as Admin, this software allowed me to log out with their username still in the log in text box. We recently upgraded a large quantity of systems to Wins7 and WinEmbedded7 and that program no longer works due to the
    registry change.
    Currently the best I could to for replicating that software function as .bat file is:
    call reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\LogonUI" /v LastLoggedOnSAMUser /t REG_SZ /d "domain/username" /f
    call reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\LogonUI" /v LastLoggedOnUser /t REG_SZ /d "doamain/username" /f
    pause
    When I log out, it leaves the user name and password blank which is OK but I need to take it one step further. I need the values of:
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\LogonUI
    "LastLoggedOnSAMUser"="domain\username"
    "LastLoggedOnUser"="domain\username"
    to match the values that are in
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\LogonUI\SessionData\1
    "LoggedOnSAMUser"="domain\username"
    "LoggedOnUser"="domain\username"
    Any suggestions on what I need to change in my code to manipulate the registry to match those values without having to manually input them?

    - Vegan Fanatic
    "can you fix the cyt.exe program, that would be the best option long term"
    Well the cyt.exe program hasn't been updated since 2000 (version 2.3 and 2.5 were the latest versions) so I can only assume the developer has abandoned the project. The reason why it doesn't work anymore is because of the registry change going from XP to
    Vista/Win7/Win8.
    Once I have my own batch file, it will be easier to tweak it as needed when an operating system changes then it is to rely/wait on someone else to update a very specific piece of software that only has one small purpose that has most likely been forgotten.
    As much as I would like to modify the existing program, I don't have any software I can use to re-program it and I doubt I have enough knowledge or experience to tweak it correctly.
    - Frederik Long
    "You need to experiment either with reg query / reg add or reg export / reg import. Each of these commands has inbuilt help, e.g. reg import /?."
    From what I tested, the export/import copies the file and its values and placed them where I asked it too. That is not what I need. I need the values ONLY and placed within the file I need which has a different name from the file I exported from.

  • How to call a java class in a bat file

    Hi
    I need to call a Test.java class in a bat files .It refer .DOM.jar
    in C:/url; How do i call the java class i need the syntax
    Thanks lot

    assuming lanch.bat, Test.class and DOM.jar are in c:\url
    assuming %JAVA_HOME% is defined (else substitue it with your java installation directory)
    here is the content of launch.bat:
    cd C:/url (or cd c:\url ) (or cd c: followed by cd url)
    %JAVA_HOME%\bin java -classpath .;DOM.jar Test
    hop that'd help,
    marvinrouge

  • Trying to run a bat file from oracle

    I have followed these steps, see bottom for results, everything is valid but the bat file does not run???? PLease need your help. Doug
    CREATE OR REPLACE AND COMPILE JAVA SOURCE NAMED "getbatx" AS
    class getbatx //class pdfopen
    public static void execmd(String c) //main function
    try
    System.out.println("Executing:" + c);
    Runtime.getRuntime().exec("C:\\WINDOWS\\system32
    cmd.exe /c "+c);
    System.out.println("Executing:" + c + " ...done");
    } catch (Exception e) //catch any exceptions here
    System.out.println("Error" + e ); //print the error
    CREATE OR REPLACE PROCEDURE host_command2 (p_command IN VARCHAR2)
    AS LANGUAGE JAVA
    NAME 'getbatx.execmd (java.lang.String)';
    /Then as sysdba I put in in the following.
    exec dbms_java.grant_permission( 'CAPRS', 'SYS:java.io.FilePermission', '<<ALL FILES>>', 'execute' );
    EXEC Dbms_Java.Grant_Permission('CAPRS', 'SYS:java.lang.RuntimePermission', 'writeFileDescriptor', '');
    EXEC Dbms_Java.Grant_Permission('CAPRS', 'SYS:java.lang.RuntimePermission', 'readFileDescriptor', '');Then I make the call.
    SET SERVEROUTPUT ON SIZE 1000000
    CALL DBMS_JAVA.SET_OUTPUT(1000000);
    BEGIN
    host_command2 (p_command => 'c:\mybook.bat');
    END;
    /***** I run this, it completes but does not run the bat file and there is no error message
    SQL> BEGIN
    2 host_command2 (p_command => 'mybook.bat');
    3 END;
    4 /
    Executing:mybook.bat
    Executing:mybook.bat ...done
    PL/SQL procedure successfully completed.

    Yes it should open a dos box, but you forgot to add the .bat file witch you like to run: String[] command = {"cmd", "/c", "start", "c:/Batch files/Cardiobackup/cardiobackup_v1.4"}

  • Error while deployment BAT file

    When deployment BAT file i have an error with description "1" and Message ID "10006". Therefore bat file has been successfully executed on client computer.
    The customer asks reports of deployment so i can't show report with errors only))
    Can anybody give an advise with this situation?
    If answer is helpful, please mark as answer or hit the green arrow on the left.

    If you are using the application model, you can add return code 1 as a success in the
    Return Codes tab of the deployement type. If not you can catch the exit code 1 in your batch file and return a 0 instead.
    My Blog: http://www.petervanderwoude.nl/
    Follow me on twitter: pvanderwoude

  • Open bat file on client machine using webutil

    Hi all.
    I'm on devsuite 10g.
    I want to run a bat file on client machine using client_host function of webutil.
    I have tried first to execute the bat file with mouse double-click in order to check if it is ok, and it works.
    Now I want to execute this file from my form using webutil.
    Here is my code:
    --> with this code I select a file from client machine
    Declare
         LC$Fichier Varchar2(1000):=null ;
         PC$Filtre Varchar2(2000) := '|All files|*.*|' ;
    Begin
         LC$Fichier := WEBUTIL_FILE.FILE_OPEN_DIALOG
         null,
         PC$Filtre,
         'Seleziona un file da caricare'
    If LC$Fichier is not null Then
    :output.apri_file := LC$Fichier ;
    End if ;
    End ;
    --> with this code I execute the file that I have opened
    declare
         cmd varchar2(30000) := null;
    BEGIN
         Cmd := 'cmd /c start "" "' || :output.apri_file || '"' ;
    CLIENT_HOST(cmd);
    END;
    When I execute my form I have this error:
    Exception in thread "main" java.lang.NoClassDefFoundError: ....folder of file opened.
    Can anyone help me to solve this problem??
    Thanks in advance,
    Fabrizio

    Fabrizio Delli Priscoli wrote:
    Hi Tony.
    I have tried to run my bat file with double-click and everything is OK.
    When you say the DOS window opens for few second, is your batch file being executed?? did you see the results??
    The answer in NO for both of your questions.
    If I try to drag and drop the file I have error.
    How can I attach an image to this post, so that you can see the error??
    Thanks,
    FabrizioThis seems like a directory or OS level permission issue on the batch file, What is the error you got when you tried drag and drop the batch file in an DOS window???
    I think you need to upload the image to a site and use the markup for the image, include the full URL of the uploaded file between ! (exclamation marks) something like ! http://../post.gif ! without the spaces.
    Tony
    Edited by: Tony Garabedian on Sep 4, 2008 12:30 PM

  • How do I reset the default file association for .bat files on Windows 8.1?

    Windows 8.1 allows the user to change the file association for .bat files. I made the mistake of using this facility to change the default file association for .bat files to Notepad++. Now when I attempt to run a .bat file, the script for the .bat
    comes up in Notepad++, instead of its being run as an executable file!  All my .bat files are now useless. I tried finding a way to change this back to the original executable setting, including deleting Notepad++ from my system, but nothing
    has worked. 
    There are discussions that I found on the Internet about this problem, and the solutions to which I was led have not worked either. Most of the solutions apply to Windows 7 or Vista, but not to Windows 8. There are a few solutions that purport to apply to Windows
    8 and 8.1, but they do not work for me.  
    (Disconcertingly, some of the solutions presented for the problem that apply to Vista or Windows 7 and are dated as early as 2009, so this problem has apparently been around for some time, but Microsoft still keeps .bat files on the Control Panel facility that
    enables the change to be made. I cannot see why, but there it remains.)
    Can someone please help me change this file association back to the original setting for Windows 8.1? Remember, most if now all the links that address this issue are focused on Windows 7. I need an answer that has been tried and proven to apply to Windows 8.1.
    Nothing I have tried works.

    Hi,
    For the issue, we can restore Default File Extension Type Associations through adding the registry entries.
    1. Download the .reg file from the following link.
    http://www.eightforums.com/attachments/tutorials/8025d1345781188-default-file-associations-restore-windows-8-bat.reg
    Note: Microsoft provides third-party contact information to help you find technical support. This contact information may change without notice. Microsoft does not guarantee the accuracy of this third-party contact information.
    2. Save the .reg file to your desktop.
    3. Double click on the downloaded .reg file to Merge it.
    4. If prompted, click on Run, Yes (UAC), Yes, and OK to approve the merge.
    5. Sign out and in, or restart the computer to apply.
    6. If you are logged in as a standard user and this still does not help, then have the administrator also merge the needed .reg file for the listed file extension or protocol below while logged into their administrator account.
    Hope this helps.
    Regards,
    Kelvin hsu
    TechNet Community Support

  • How to run sql query in bat file in task schedular at every 10 seconds

    This is my sql script :
    DECLARE @countRows INT,
    @currDate DATE,
    @checkForTasks INT,
    @created_by_id INT,
    @gst_ID int;
    SET @currDate = Getdate()
    SET @countRows = (SELECT Count(*)
    FROM [dbo].[sd_gst_effective_table]
    WHERE isapplied = 0)
    IF @countRows > 0
    -- Check for those GST''s who are not applied yet : if they are greater than 0 then perform next task
    BEGIN
    SET @checkForTasks = (SELECT Count(*)
    -- Check is current date equals to task date or not
    FROM [dbo].[sd_gst_effective_table]
    WHERE effect_date = @currDate AND isapplied = 0)
    IF @checkForTasks > 0
    -- If current date = task date then perform this task
    BEGIN
    SET @created_by_id = (SELECT TOP 1 createdby FROM [dbo].[sd_gst_effective_table] WHERE effect_date = @currDate AND isapplied = 0)
    SET @gst_ID = (SELECT gst_id FROM [dbo].[sd_gst_effective_table] WHERE effect_date = @currDate AND isapplied = 0)
    -- STEP 1 :: InActivate the existing GST according to createdbyID
    UPDATE sd_gst_rate
    SET isactive = 0,
    inactivedate = Getdate()
    WHERE isactive = 1
    AND createdby = @created_by_id
    -- STEP 2 :: Activate the New GST according to implementation date and gstID
    UPDATE sd_gst_rate
    SET isactive = 1,
    activedate = Getdate()
    WHERE id = @gst_ID
    -- STEP 3 :: Inactivate the applied GST from sd_gst_effective_table
    UPDATE [dbo].[sd_gst_effective_table] SET isApplied = 1 WHERE gst_id = @gst_ID
    END
    END
    DECLARE @Text AS VARCHAR(100)
    DECLARE @Cmd AS VARCHAR(100)
    DECLARE @value nvarchar(1000);
    SET @value = (SELECT CONVERT(TIME,GETDATE()) AS HourMinuteSeconds);
    SET @Text = 'File Writed ' + @value
    SET @Cmd ='echo ' + @Text + ' > E:\AppTextFile.txt'
    EXECUTE Master.dbo.xp_CmdShell @Cmd
    This is resided in videos folder of windows , i have created a task schedular in windows 8.1 to run daily at every 10 seconds , but it is not working ... Please tell me how to deal with it.
    Please note : This sql query is running perfectly in sql server. Query have no errors. Please check whats wrong with my time schedular. I just want my schedular to run every 10 seconds regardless of date.

    Hi Emad,
    Is your script in a ".sql" file? May I know how you configure the schedule task action?
    Since you didn't mention how you configure the schedule task, can you confirm you have followed the below step correctly?
    Save your script in a ".sql" file.
    Create a ".bat" file and call the sql file above inside with
    sqlcmd.exe, you can reference
    here.
    Configure a schedule task to run the ".bat" file in a certain interval.
    Have you tried to run the script in you bat file in a standalone commandline window? Please post the script in your bat file, It can help to diagnose the issue.
    If you have any question, feel free to let me know.
    Eric Zhang
    TechNet Community Support

  • Encryption through bat file in SAP

    dear all,
    I want to call a *.bat file ( created in Java ) in mm ABAP program to encrypt the file for Bank use.
    Can anyone plz help me in this, will RFC help in this? the file is located at local drive in PC.
    how to give Input and Output file parameters??

    Hi,
    You can use SM69 to define your command and run this command using MF SXPG_COMMAND_EXECUTE. But this can works if you upload the file on the server.
    Regards

  • Encryption through bat file.

    dear all,
    I want to call a *.bat file ( created in Java ) in mm ABAP program to encrypt the file for Bank use.
    Can anyone plz help me in this, will RFC help in this? the file is located at local drive in PC.

    May be you can try these FM.
    Use the following FM to encrypt
    CALL FUNCTION 'FIEB_PASSWORD_ENCRYPT'
    Use the following FM to decrypt
    CALL FUNCTION 'FIEB_PASSWORD_DECRYPT'
    ******Reward points,if found useful

Maybe you are looking for