So won't need "sh" or "bat" files, make jar's MANIFEST take params!!

Right now a jar file's manifest can have a "main-class" which makes the jar truly executable - you can double-click it. The problem is, if you need environment variables, there is no way to pass them in to your main-class' "args."
So why don't we make it so when the jar's manifest is read, that in addition to "main-class" you can have "main-args"?
That would mean everyone would no longer need to bundle java apps with ".exe" or ".bat" or ".sh" files!!! We could have truly Java applications, that are executables!!!
Just package them in a jar, have a main class and the args for it!!
what does everyone think?

basically here is my problem:
What do I do if my "jar" needs to use classes that are located in a folder created by the user (i.e. I want my app to be able to work together with their app's classes) and those files' location are in the classpath? Normally I could do:
java -classpath /fldr/blah.jar -jar MyJar.jar
however, if i want someone to be able to simply double-click it (or if they have Personal Java in which case there is no command-line for users), then what do i do?
How would my app find their classes?
It would throw an exception.
So my question is: how can i solve this, since as far as i can see, a jar and manifest can't send info to the command-line or java.exe here.
(One solution might be to do runtime.exec(java -classpath ...), but the problem with this is that if I do that with %CLASSPATH% or some other env. variable, then it won't work, it simply treats it as a string %CLASSPATH%. And i don't know if you know this, but if you do java -classpath, then that OVERRIDES your classpath! So you have to remember to include your existing classpath in that. Anyways that's only one example.)

Similar Messages

  • Need to execute bat file by GPO with admin rights

    Hi all
    I created a specific bat file that run regini.exe with specific parameters to set a specific permission in a specific registry key.
    I can execute this bat file from GPO but I need that this bat runs with domain admins rights otherwise script not set the permission in user's registry key.
    Have you any ideas?
    Thanks
    Chris

    > Yes I tested this solution but it's not possible set permission to the
    > key :-(
    Which key are we talking about?
    Martin
    Mal ein
    GUTES Buch über GPOs lesen?
    NO THEY ARE NOT EVIL, if you know what you are doing:
    Good or bad GPOs?
    And if IT bothers me - coke bottle design refreshment :))

  • Running a Bat file from a stored procedure

    This is part II of Re: Need to run bat file from application express
    I thought I would open a new thread
    I thought I had this fiqured out but it still doesn't work
    1) I granted CREATE EXTERNAL JOB to my user
    2) startup the OracleJobScheduler Service
    3)
    create or replace
    PROCEDURE RUN_OS_COMMAND(p_cmd IN varchar2)
    is
    v_job_exists pls_integer:=0;
    begin
      select count(1)
      into  v_job_exists
      from  all_scheduler_jobs
      where job_name='JAVA_EXE';
      if v_job_exists>0 then 
        dbms_scheduler.drop_job(job_name =>'JAVA_EXE');
      end if;
      dbms_scheduler.create_job
      (   job_name          =>'JAVA_EXE'
        , job_action        =>p_cmd
        , job_type          =>'executable'
        , enabled           =>false
        , auto_drop         =>false
        , start_date        =>systimestamp
      dbms_scheduler.run_job(job_name =>'JAVA_EXE');
    end;test.bat is del test.csv
    I run this
    begin
      RUN_OS_COMMAND('C:\temp\test.bat');
    end;
    / anonymous block completed
    It runs with no errors but does not run the bat file... what am i missing, thanks Doug

    LLUSERSPROFILE=C:\Documents and Settings\All Users
    APPDATA=C:\Documents and Settings\wblincoe\Application Data
    CLASSPATH=.;[ORACLE_HOME]\jdbc\lib\ojdbc6.jar;c:\myjar\xdocore.jar;c:\myjar\i18nAPI_v3.jar;c:\myjar\xdoparser.jar;c:\myjar\xmlparserv2.jar
    CommonProgramFiles=C:\Program Files\Common Files
    COMPUTERNAME=WBLINCOELT
    ComSpec=C:\WINDOWS\system32\cmd.exe
    DEFLOGDIR=C:\Documents and Settings\All Users\Application Data\McAfee\DesktopProtection
    FP_NO_HOST_CHECK=NO
    HOMEDRIVE=C:
    HOMEPATH=\Documents and Settings\wblincoe
    LDMS_LOCAL_DIR=C:\Program Files\LANDesk\LDClient\Data
    LOGONSERVER=\\03N-DAYT-DC01
    NUMBER_OF_PROCESSORS=2
    OS=Windows_NT
    Path=C:\OraHome_1\jre\1.4.2\bin\client;C:\OraHome_1\jre\1.4.2\bin;C:\app\wblincoe\product\11.1.0\db_1\bin
    PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH
    PERL5LIB=C:\oracle\product\10.2.0\http_1\sysman\admin\scripts;C:\oracle\product\10.2.0\http_1\perl\site\5.6.1\lib;C:\oracle\product\10.2.0\http_1\perl\site\5.6.1;C:\oracle\product\10.2.0\http_1\perl\5.6.1\lib\MSWin32-x86;C:\oracle\product\10.2.0\http_1\perl\lib\5.6.1;C:\oracle\product\10.2.0\http_1\perl\lib\5.6.1\MSWin32-x86;
    PHPRC=C:\Program Files\PHP\
    PROCESSOR_ARCHITECTURE=x86
    PROCESSOR_IDENTIFIER=x86 Family 6 Model 15 Stepping 2, GenuineIntel
    PROCESSOR_LEVEL=6
    PROCESSOR_REVISION=0f02
    ProgramFiles=C:\Program Files
    PROMPT=$P$G
    SESSIONNAME=Console
    SystemDrive=C:
    SystemRoot=C:\WINDOWS
    TEMP=C:\DOCUME~1\wblincoe\LOCALS~1\Temp
    TMP=C:\DOCUME~1\wblincoe\LOCALS~1\Temp
    USERDNSDOMAIN=CACI.COM
    USERDOMAIN=CACI
    USERNAME=wblincoe
    USERPROFILE=C:\Documents and Settings\wblincoe
    VSEDEFLOGDIR=C:\Documents and Settings\All Users\Application Data\McAfee\DesktopProtection
    windir=C:\WINDOWS

  • Running Bat file in Minimized Mode

    Hai All,
    I need to run bat file using Runtime, Bat file should run in minimized
    mode ...
    any one help me
    Regards
    Yuva

    Assuming it's windows...
    start /min mybatchfile.batOpen a command prompt and type "start /?" to see the params available.
    regards,
    Owen

  • Runtime.exec(bat file) : doesn't display stdio

    Hello, I need to start bat files from my Java Application
    to do this, I use
    Runtime.getRuntime().exec("my_bat.bat");
    a Dos console is opened.
    if my_bat.bat
    starts notepad.exe ==> it works
    if my_bat.bat
    does echo hello world ==> nothing is displayed.
    I would like the STDOUT procuded by the .bat file to be
    displayed in the console.
    Anyone can help me?
    Regards.

    You need to get the input stream from the process, and print out what it sends. Simply calling "waitFor()" will wait forever, since the stdout characters need to be read.
    Try this :
    InputStream st = Runtime.getRuntime().exec("hello_world.bat").getInputStream();
    int n;
    while ((n = st.read()) >= 0) {
      System.out((char)n);
    }Walter Gildersleeve
    Productivity Engineering, GmbH
    Freiburg, Germany

  • Execute .bat file using cfexecute tag...

    Hello,
    I am trying to execute a batch file using cfexecute tag. This
    batch file needs 1 command line arguement, which I am passing using
    arguments
    Text attribute.
    When I run my batch file directly from command prompt, it
    works perfectly. but while using cfexecute, it doesn't seem to do
    anything.
    Note:- I am trying to encrypt a txt file using GPG algorithm
    in the batch file.
    Thanks in advance!
    Manju

    Hello,
    you have probally worked this out but if any of this helps :)
    I run an application that needs to print via dos command, so
    my cfm page makes a batch file writes some arguments to it then
    calls it with a cmd. the code is below if any of it helps im glad.
    (creates name for my bat file)
    <cfset BFname = '#namevariable#' & '.bat'>
    (sets up the text I need in the bat file)
    <cfset content = 'copy
    "c:\inetpub\wwwroot\mct\picklist.txt"
    \\MyPrintServer\ThePrinter'>
    (writes the bat file with the text in the content var)
    <cffile action="write"
    file="c:\inetpub\wwwroot\mct\#BFname#" output="#content#">
    (calls cmd to run the bat file)
    <cfexecute name="c:\windows\system32\cmd.exe"
    arguments="/c c:\inetpub\wwwroot\mct\#BFname#"
    outputfile="c:\inetpub\wwwroot\mct\log_output.txt"
    timeout="1"></cfexecute>
    Regards Guy

  • Hiding the command prompt when executing bat file

    Hi,
    I hava a bat file which contains following
    java -jar MyJar.jar
    When I execute the bat file, the jar file is executed. But a command prompt also opens along with it. I dont want to display the command prompt to the user. Is there any way to hide that command prompt ?
    regards,
    Jatin.

    Is your problem solved?
    If not then
    insted of creating a batch file create a form file in visual basic and write following code in it
    shell "java -jar MyJar.jar"
    Endand then create its exe file.
    It will just launch your jar file and then exit.

  • I bought a canon EOS Rebel T5i. It came with photoshop elements 11.  PS won't open my C2 raw files and says my camera isn't supported by the software I have downloaded 7.4 dng converter and I still can't open the files.  What do I need to do?

    I bought a canon EOS Rebel T5i. It came with photoshop elements 11.  PS won't open my C2 raw files and says my camera isn't supported by the software I have downloaded 7.4 dng converter and I still can't open the files.  What do I need to do?

    You need camera raw 8.4 for your camera, if it’s Digital Rebel T5 EOS 1200D EOS Kiss X70. It is not compatible with PSE11; so it’s a bit odd if that software was bundled with the camera except that it will work with jpegs. I suggest you download and install the free Adobe DNG converter to convert your CR2 files to the Adobe universal Raw format and the DNG files will editable in PSE11(keep your originals as backups and for use in the camera manufactures software)
    Mac download (.dmg file) click here DNG Converter 8.4
    You can convert a whole folder of raw images in one click. See this quick video tutorial:
    You Tube click here for DNG Converter tutorial

  • Need to run powershell script in a bat file

    I have a ps1 file with the following:
    Get-ADUser -Filter * -SearchBase "ou=<HOSPOU>,ou=Domain Users and Groups,dc=<hospdomain>,dc=local" -Properties Description,EmailAddress| Select-Object -Property Name,SamAccountName,Description,EmailAddress|Export-Csv "\\<server>\home2$\information
    services\IS STAFF\Documentation\AD Info\smcusers.csv";
    I have a bat file:
    @ECHO OFF
    SET ThisScriptsDirectory=%~dp0
    SET PowerShellScriptPath=%ThisScriptsDirectory%smcusers.ps1
    %windir%\system32\WindowsPowerShell\v1.0\powershell.exe -noexit -command import-module ActiveDirectory "%PowerShellScriptPath%";
    But while it launches powershell with the AD module, It apparently cannot read the ps1 file.
    I get:
    H:\>C:\Windows\system32\WindowsPowerShell\v1.0\powershell.exe -noexit -command i
    mport-module ActiveDirectory "H:\smcusers.ps1";
    Import-Module : A positional parameter cannot be found that accepts argument 'H
    :\smcusers.ps1'.
    At line:1 char:14
    + import-module <<<<  ActiveDirectory H:\smcusers.ps1;
        + CategoryInfo          : InvalidArgument: (:) [Import-Module], ParameterB
       indingException
        + FullyQualifiedErrorId : PositionalParameterNotFound,Microsoft.PowerShell
       .Commands.ImportModuleCommand
    I have tried to modify the parameters 
    %windir%\system32\WindowsPowerShell\v1.0\powershell.exe -noexit -command import-module ActiveDirectory -File "%PowerShellScriptPath%";
    Still no luck.
    I need to be able to run this as a scheduled task.
    Karon W

    Apparently I don't know where to put everything.
    I have a single line:
    %windir%\system32\WindowsPowerShell\v1.0\powershell.exe -noexit import-module ActiveDirectory; -Command {Get-ADUser -Filter * -SearchBase "ou=Shannon Memorial,ou=Domain Users and Groups,dc=shannonhealth,dc=local" -Properties Description,EmailAddress|Select-Object
    -Property Name,SamAccountName,Description,EmailAddress|Export-Csv "\\svr-resource2\home2$\information services\IS STAFF\Documentation\AD Info\smcusers.csv"}
    This is the response:
    H:\>C:\Windows\system32\WindowsPowerShell\v1.0\powershell.exe -noexit import-mod
    ule ActiveDirectory; -Command {Get-ADUser -Filter * -SearchBase "ou=Shannon Memo
    rial,ou=Domain Users and Groups,dc=shannonhealth,dc=local" -Properties Descripti
    on,EmailAddress  | Select-Object -Property Name,SamAccountName,Description,Email
    Address  | Export-Csv "\\svr-resource2\home2$\information services\IS STAFF\Docu
    mentation\AD Info\smcusers.csv"}
    'Select-Object' is not recognized as an internal or external command,
    operable program or batch file.
    I modified to 2 lines:
    %windir%\system32\WindowsPowerShell\v1.0\powershell.exe -noexit import-module ActiveDirectory;
    Get-ADUser -Filter * -SearchBase "ou=Shannon Memorial,ou=Domain Users and Groups,dc=shannonhealth,dc=local" -Properties Description,EmailAddress|Select-Object -Property Name,SamAccountName,Description,EmailAddress|Export-Csv "\\svr-resource2\home2$\information
    services\IS STAFF\Documentation\AD Info\smcusers.csv"
    This is the response:
    H:\>C:\Windows\system32\WindowsPowerShell\v1.0\powershell.exe -noexit import-mod
    ule ActiveDirectory;
    PS H:\> exit ************I had to type*****************
    H:\>Get-ADUser -Filter * -SearchBase "ou=Shannon Memorial,ou=Domain Users and Gr
    oups,dc=shannonhealth,dc=local" -Properties Description,EmailAddress  | Select-O
    bject -Property Name,SamAccountName,Description,EmailAddress  | Export-Csv "\\sv
    r-resource2\home2$\information services\IS STAFF\Documentation\AD Info\smcusers.
    csv"
    'Get-ADUser' is not recognized as an internal or external command,
    operable program or batch file.
    If I paste the command in before I type exit, it works. 
    If I paste:
    %windir%\system32\WindowsPowerShell\v1.0\powershell.exe -noexit import-module ActiveDirectory;
    I am put in the ad powereshell
    Then I paste:
    Get-ADUser -Filter * -SearchBase "ou=Shannon Memorial,ou=Domain Users and Groups,dc=shannonhealth,dc=local" -Properties Description,EmailAddress|Select-Object -Property Name,SamAccountName,Description,EmailAddress|Export-Csv "\\svr-resource2\home2$\information
    services\IS STAFF\Documentation\AD Info\smcusers.csv"
    and I get the expected output.
    What do I need to have in the bat file so the 2nd line of the script will run? and where does it go?
    Karon W

  • I need to copy a file over to my mac from a CD but it won't let me due to read write permissions. is it possible to get around this?

    i need to copy a file over to my mac from a CD but it won't let me due to read write permissions. does anyone know of a way to get around this?
    any assistance will be much appreciated

    i need to copy a file over to my mac from a CD but it won't let me due to read write permissions. does anyone know of a way to get around this?
    any assistance will be much appreciated

  • Scheduled task won't run .bat file

    Hi. On Windows Server 2008 I have a scheduled task that calls a .bat file. The fist step in the .bat file is write to a log file to the same directory in which the .bat file exists. This allows me to find out if it is ever run. When the .bat file is run from a command prompt it runs as expected writing to the log file and completing its actions. My problem is that when I run the scheduled task manually or allow it to run when scheduled it appears to run but the .bat file is never run. No log file is ever created. The History tab in the properties of the scheduled tasks shows the task being started and running then completing with an operation code of 2. I've disabled the UAC for the user account. I've set the task to run as the Administrator user and verified the permissions for that user. I know the password is correct for the task because I can make changes to the properties and save those changes with the username/password. I'm at a loss for further troubleshooting steps. Can anyone point me in the right direction to figure out why these .bat files are not being run? 

    So I had this problem, I double clicked on the .bat and notepad opened the .bat.  I ran through this whole long and very absorbing thread of this forum.   I wanted to save the entries that were most helpful, so I copied and pasted into
    a notepad document (.txt)  I could not find a way to attach it here, so I copied and pasted that below. I called it a synopsis....  Did I spell that right?
    As you can see, I added my experience at the top (A and B).  The stuff I copied is noted with the original author. This is the first time I posted anything to these here microsoft forums, although I have been telling computers what to do for 40+ years. 
    So hope I did not break any social protocols here.
    ==================================== Begin ====================================
         Running A Dot Bat File in Windows Server 2008 Vista 7 etc and beyond V01
    ============================================================================
    This was created as a synopsis of the entries at the following forum location:
    http://social.technet.microsoft.com/Forums/en/winservermanager/thread/d47d116e-10b9-44f0-9a30-7406c86c2fbe
    A) manually
         This is an opinion added by Thomas Rock
        1) Open a command window (that would be cmd.exe)
        2) In the command window navigate to the directory containing the .bat file and it's dependents
               ex...  C:\Program Files (x86)\Bobs\Your\Uncle
        3) Run the .bat file by typing the name including the .bat extension (in the command window of course)
                 TheBatFile.bat
           Note: Using this method, the .bat file will run in the current command window directory (the directory where the .bat file is located)
                             (this is the key for getting it to run in the task scheduler... Start in folder option)
    B) The double click
                This is an opinion added by Thomas Rock
         1) Using Windows exlporer, find the .bat file
         2) use the mouse or other device to double click on the .bat file
         3) if it does not run (in my case the wordpad application opened the .bat file)
              a) make sure that the .bat file extension is associated with the program c:\windows\system32\cmd.exe
              b) make sure the profile you are using has rights to run the cmd.exe
              c) make sure the profile has the rights to the directories, the .bat and any other objects used or affected by the .bat file processing.
    C) As a task using task scheduler
         Proposed As Answer by Brian Vandemark Wednesday, September 02, 2009 9:36 PM
    1) Make sure that the task is set to "configure for Windows Vista or Windows 2008" on the first page of the task properties (under the "general" tab)
    2) Make sure that the task is set to "start in" the folder that contains the batch file:
          a) open the task properties
          b) click on the "actions" tab
          c) click on the action and then the "edit" button at the bottom. 
          d) In the "Edit Action" Window there is a field for "start in (optional)" that you set to the path to the batch file.
          e) be sure to include an end backslash for the start in path "C:\dir1\dir2\"    (the last backslash is not optional)
    3) Make sure that the task is running as an account that has explicit "Full access" permissions to all these things:
          a) the .bat file itself
          b) the folder containing the .bat file
          c) the target files/folders that are affected by the .bat script. 
               Note:  Inherited permissions did not seem to work.
    4) Make sure that the account running the task is a member of the local "administrators" group for this machine
    5) Make sure that the task is set to "run whether logged on or not"
    6) Tick the box "Run with highest privileges".    
           Note: Point 6 here was from Edson F. Lima Wednesday June 30 2010 1:35 PM
                      The original point 6 was moved to point 7.
    7) The Task should run successfully with expected output when you right-click on the task and select "run" 
            If it does that then it will run successfully when you are logged off.
    D) Still another way as a task using task scheduler
          Proposed As Answer byDarren Wallace Thursday, July 15, 2010 1:41 AM
    This has been bugging me for 6 or 7 months.
    I don't have admin rights to the box and the guy who does is very busy...
    so I've felt the range of emotions mentioned above.
    I tried most everything above as well. But what seemed to get my processes processing, was ...
       • on the General tab, I clicked the Change User or Group button
       • in Select User or Group (first smaller dialog box)  I clicked the Advanced... button
       • in the next Select User or Group (second bigger dialog box) I clicked the Find Now button
       • in the Search results I selected the Administrators (a group) and it returned SERVERname\Administrators into the "Enter the object name to select" entry in the previous dialog box
       • then I clicked OK and returned to the General tab above
       • the options to Run only when user is logged on and Run whether user is logged on or not are no longer available
       • then I made sure that the Run with highest privileges was checked
       • then I clicked OK and during the next scheduled time to run ... it ran
       Note: See note in A) Manually above.
    E) Task scheduler recommendation
         Proposed As Answer byTamusJRoyceThursday, December 01, 2011 3:42 PM
    I have found .bat and .cmd files do not run correctly either.
        My solution:  Don't run the batch file directly. 
           Have TaskScheduler run:  cmd.exe
              with parameter:  /C YourBatchFile.bat
             and start in: C:\SomePath\ (without quotes!) where C:\SomePath\YourBatchFile.bat exists. 
            And then select the radio button for it to run regardless if you are logged in or not.
    Exit errors may not be logged to the Event Log (they weren't when the .bat ran directly from Task Scheduler when I was logged in), so I find it best to manually log your own Event in case a error occurs and you want to send an email.
     REM Logs an event which causes eventlog to send an email when it fails.  Also, "/l application" needs to be lowercase.
    eventcreate /t error /id 203 /l application /d "your logged description."
    And then make a completely separate task with a trigger:  On an event.  Basic Selected.  Log: Application.  Source: EventCreate. Event ID: 203.  And have the action on this task send an email (attaching any generated log files, if needed).
    Hopefully helpful (took me 3 days to figure all this out...gar)
    ===================================== End ===================================
         Running A Dot Bat File in Windows Server 2008 Vista 7 etc and beyond V01
    ============================================================================
     

  • 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

  • Execute bat file with cfexecute

    Hello,
    this is a newbie question but I'm stuck. I have a .bat that
    runs fine through the command prompt but won't run with
    <cfexecute>, it merely seems to read the .bat but not execute
    it. The .bat reads:
    java -classpath
    ".;C:\CFusionMX7\wwwroot\i-recall\javaClasses\GATE-3.1\bin\gate.jar"
    AnnieAPI
    When I run <cfexecute
    name="C:\CFusionMX7\wwwroot\i-recall\javaClasses\GateClasspathRun.bat"
    variable="myVar" timeout="100">
    </cfexecute>
    The output looks like this:
    C:\CFusionMX7\runtime\bin>java -classpath
    "C:\CFusionMX7\wwwroot\i-recall\javaClasses\GATE-3.1\bin\gate.jar"
    AnnieAPI
    It simply reads it and doesn't execute the java AnnieAPI
    command. I didn't write this .bat file so maybe I need to add
    something to make it run. Any help is appreciated.
    -Kalen G

    Same thing, just without the classpath in the output:
    C:\CFusionMX7\runtime\bin>java AnnieAPI
    Even if I remove the class path and simply leave java
    AnnieAPI it doesn't run. It should get an error message without the
    classpath or something but I don't And the page loads so quickly
    it's obvious that Coldfusion is just reading the code and not
    executing it.
    Thanks

  • Convert .bat file to .msi

    Hi everyone!
    Please help....
    The case is that I first have to run a batch file (which takes about 2
    minutes, because it removes an application) and then AFTER it has run, I
    need to run an application packet. I know that it should be possible to
    just write the batch script into the "launch before" script of the app.
    packet. But it doesnt work. So therefore I will try to convert the .bat
    file into a .msi packet. In that way I can use the "depend on another
    app.packet"-function.
    So please does anyone know how to convert from .bat to .msi?
    Or maybe another solution?
    THANKS!!!
    Chrisitan

    Yes I´m deleting directories. Actually it´s uninstalling one anti virus,
    so it can install another vendors anti virus.
    But I solved the problem. I put an # before launching the .bat file in
    the login script.
    And after that I used Zenworks to distribute the app. packet.
    Since the .bat file takes about 2 minutes to run I added a copy of a
    simply file from the
    server to the computers harddrive. Then I use a "if exist....else goto
    exit" script. In that
    way it won´t run the .bat file on every login.
    But I still don´t understand why the "launch before" can´t read the .bat
    file script.
    But anyway....thanks for your reply....this case is solved.
    Marcus Breiden wrote:
    > Christian wrote:
    >
    >> Hi everyone!
    >> Please help....
    >>
    >> The case is that I first have to run a batch file (which takes about 2
    >> minutes, because it removes an application) and then AFTER it has run, I
    >> need to run an application packet. I know that it should be possible to
    >> just write the batch script into the "launch before" script of the app.
    >> packet. But it doesn?t work. So therefore I will try to convert the .bat
    >> file into a .msi packet. In that way I can use the "depend on another
    >> app.packet"-function.
    >
    > hmm... are you deleting directories? I would really try to get that batch to
    > run.. could you post it?
    >
    >> So please does anyone know how to convert from .bat to .msi?
    >> Or maybe another solution?
    >>
    > Software Packing which is part of the suite would allow that, but it would
    > only remove existing files... so if you delete a dir with 4 files during
    > creating of the msi it would afterwards only delete that dir with those 4
    > files... no other files..
    >
    > not a good approach IMHO..

  • Running .bat files as administrator on win 7 and win 2k8 machines

    I have .bat which will be copied onto Win 7 and Win 2k8 machines remotely. The batch file contains scripts to stop and restart Windows services, like,
    net stop "Adobe Acrobat Update Service".
    Now when I run this batch file, I get "System error 5 has occurred. Access is denied."
    I understand that I need to run this batch file as administrator (here by administrator I mean, Windows default administrator.).
    Does anyone have a solution for this?
    P.S: 1) "run as" command inside the .bat file won't work, since you need to run the .bat file itself as administrator (here by administrator I mean, Windows default administrator.).
    2) I can create another batch file (say b.bat) containing the "run as" command and invoking the the original batch file (say a.bat), which has the command net stop "Adobe Acrobat Update Service". But still, this won't solve the issue, since you can run as,
    the user, who has administrator privileges and not run as administrator (here by administrator I mean, Windows default administrator.) itself.

    Suhas,
    Can you explain me why you want to do this?
    Maby there are there some beter ways to achive your goal.
    The reason why this doesn't work is UAC who strips the administrator tokens from your user account.
    So it is not nesseary to use the default windows administrator account. Just a user with administrative priviliges will do you only need to run this command elevated.
    There are several ways to run this command elevated:
    Just right click on the batch file and choose the option run as administator.
    Quite simple but a no go if you wanna have a fully automated solution
    Use PsExec.exe  from the pstools suite (avaible
    here)
    If you use the command like this:
    PSEXEC -u domain\user -p password -h net stop spooler
    PSEXEC -u domain\user -p password -h net start spooler
    Or from a remote machine (pcX = remote management machine, pcY = machine where you want to restart the service.)
    Execute this command on machine pcX:
    PSEXEC \\pcY -u domain\user -p password -h net stop spooler
    PSEXEC \\pcY -u domain\user -p password -h net start spooler
    Create a sheduled task with the "highest privlilges" that executes your batch file.
    etc ...
    Kind Regards
    DFT
    IM me - TWiTTer: @DFTER

Maybe you are looking for