Simple command line question

i was wondering if there is a way to include all jar files from a single directory on the classpath when running java app from the command line.
eg i am using this command:
java -cp ..\libs\jar1.jar;..\libs\jar2.jar;..\libs\jar3.jar;..\classes package.Main
what i want to be able to do is something like:
java -cp ..\libs\*.*;..\classes package.Main
i have tried using *, *.* and *.jar with no success. is it possible to do without setting environment variables etc.
thanks

>>
It may be more error prone, but it's stilleasier. I
use wildcards on the command line (and * in SQL)all
the time, with few or no problems.
Seriously this is a bad idea and you should stop
doing it.
You should always name your columns for SELECT (and
for INSERT as well). For SELECT queries it offers the
following benefitsSorry--I should have been more clear..
I dont' use * in production SQL--for the reasons you mentioned. But I do a lot of one-off queries for testing, debugging etc.
As for wildcards on the command line, again, for my daily putting around, there's not the risk that there is in production. In production, well, it may still be appropriate to use wildcards sometimes. You may actually want "everything in this directory, or that matches this pattern," where you don't know in advance what that will be. Regex comes to mind. :-)

Similar Messages

  • SCCM 2012 - Problems running vbscript or simple command line

    Hey everybody, I'm having a heck of a time trying to get SCCM 2012 to deploy some very simple Vbscripts or even a simple command line.  I need to deploy some registry fixes across the company as well as a Vbscript that uninstalls some old applications. 
    If I run these scripts/commands outside of SCCM everything works fine, inside of SCCM it always shows "succeeded" but it doesn't actually run correct on the client.
    What's confusing to me is the use of distribution points when you're running a command line that doesn't actually have any source files.  For instance this is what I'm trying to run "regedit /s \\servername\folder\registryfix.reg".  I've also tried
    a similar bat file as well with the same result.  I've tried it with a source folder specified, I've tried it using Run Program From Server or Download locally.  I've gone through everything I can think of but can't get it to work.
    Similarly with a vbscript I'm trying "cscript.exe /s \\servername\folder\uninstallapps.wsf" and various different settings in the package deployment.
    I'm really confused here guys so any help would be greatly appreciated.  Thanks

    What I have found is that if you try and run the REG.EXE command line directly, either as a program or via a CMD/BAT file, the 64-bit redirection will occur.  So, if you had something like this in a program or via a CMD/BAT file that ran against a 64-bit
    system:
    REG ADD HKLM\Software\Microsoft\Test /v Test /d Test
    You would end up with this registry entry existing under:
    HKLM\Software\Wow6432Node\Microsoft\Test
    That's because SCCM uses the 32-bit launcher to take care of this and redirection occurs - You can see this via the "CCM32BitLauncher.log" on the client.
    To work around this problem, I have done the following:
    On a reference machine, create/export the registry entry I want into a *.reg file - An example export of "Test.reg" for the above mentioned registry entry would look something like this:
    Windows Registry Editor Version 5.00
    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Test]
    "Test"="Test"
      2.  Stick our "Test.reg" file in a source share, create a package with the share as the source content, and distribute it
      3.  Create a program for the package with a command line like this: 
    REG IMPORT Test.reg
    This is obviously not as clean as having a command line with a package to distribute, but I find it works fine for me and gets around the redirection for registry entries.

  • Command line questions....

    I really have two questions here.
    First, I have a small server that is very similar to this one I pulled off a tutorial:
    public class MyServer{
    // A bare-bones example: exception handling omitted.
       public static void main( String args[] ){
          ServerSocket serv;
          serv = new ServerSocket( 5150 );
          while ( true ) {
             Socket s;
             s = serv.accept();          // Wait for a connection
             handle_connection( s );  // Got one, now do something!
            s.close();
    } When I run this program from the command line it goes into an infinite loop readily accepting connections.
    For the most part, this is what I want. But how do I gracefully exit the program? Simply closing the command window seems drastic, not to mention the list of exceptions it throws.
    Second question: Once I run my program, is there a way I can close the command line window and log off the computer without killing my program?
    thanks.
    (Running on NT)

    How do you stop the program? You write another program that connects to the same socket and sends a message that both programs agree means "Shutdown". When the server receives this message, it shuts down nicely.
    Now you want to run it as an NT service? I've seen people post links to a third-party package that can run a Java class as an NT service; I didn't note the link but you could probably find it by searching the forums.

  • Simple command line parameter does not seem to work; options?

    All,
    I asked an earlier question about getting an application (Olyvia) to work as a remote app.  Specifically, we were having issues with it not wanting to run for more than one user at a time.
    I found that I needed to add the "-m" (multi-user switch) to enable it to run for more than one user at a time.  I tested this by logging on to the server by two different people, bringing up a command prompt, and adding the "-m"
    to execute line.  so, "xvViewer.exe -m"  Worked great.
    Unfortunately this solution does NOT work when setting the same "-m" option in the command line parameters "Always use the following command line parameters"
    I do note that the published app name is Olyvia, but the actual application file is "xvViewer" and is called an "alias."  I'm wondering if the parameter is not being passed to the actual executable?
    Am I going to have to create a vbscript/powershell/whatever that calls the executable with the correct parameter and publish that script instead?
    Thanks,
    GeoffW

    Hi,
    Generally by passing the command line it must work but if for any specific application you are facing any error then you can try for the script\batch file and then publish as RemoteApp and check the result.
    Thanks.
    Dharmesh Solanki
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Support, contact [email protected]

  • QT Command Line Question

    I am looking for a script which I can convert movies through a simple line of code while being able to adjust Quality, file types to convert to, Frame Rates ...
    Pretty much all that Quicktime Pro can do.
    does anyone have an idea of where I can start?

    Try starting by opening the Script Editor in the /Applications/AppleScript folder, loading the QuickTime Player's AppleScript dictionary, and working until you create a script which does what you want. If you succeed in doing this, you can then create a command line method of converting the movies if you want to; post back for further assistance.
    There are a few pure command line tools for QuickTime, but all the ones I found can only play QuickTime files without having the capability to modify anything.
    (13221)

  • Audio guys, LAME command line question

    Hey I know this is not the exact forum for this question but I figured you guys could help me better than anyone. I have a G5 running tiger server and a website that is recompressing uploaded MP3 files using LAME via command line. LAME seems to be mangling some of the files by creating distorted filed and 0 byte sized files. I am wondering is there an any other mac program that I can use to reencode mp3 files with the terminal and command line? LAME is said to be great but the files that are already at the frequency that I want (44.1) are converted ok but everything else is just mangled... any suggestions. Thanks!

    I guess I'm looking for either:
    a suggestion on why LAME might be messing up files, maybe someone wlse who had similar issues with LAME and found a fix
    or
    another mac program like LAME that I can run via command line through PHP to convert files.
    I'll play with automator and see if the itunes option might work.
    Thanks!

  • DOS command line question

    Hi, Isn't there a DOS command line symbol so that when javac returns all your syntax errors you can pause the screen before it blazes by your screen and you only catch the last few syntax errors. I thought it was javac whatever.java /p, but this doesn't work.
    Thanks.......gemann

    You might try
    javac yourClass | more
    but I seem to remember trying that without success.

  • Command-Line question. Delete all but particular folders

    Hello. I need to create a batch file that will delete all folders within the "Users" folder except for the Administrator and Administrator.domainname.
    Can anyone help?
    Thanks

    You could try something along the lines of
    FOR /F "tokens=*" %%G IN ('DIR /B /A:D c:\test') DO if not "%%G" == "test2" if not "%%G" == "test3" rd /s /q "c:\test\%%G"
    but if you do, you may also delete
    c:\Users\Public
    c:\Users\Default         (a hidden folder)
    c:\Users\All Users       (a system folder)
    c:\Users\Default User (a system folder)
    Which may be regrettable. If you want an example of what happens then, try reading
    http://superuser.com/questions/219082/accidentally-deleted-user-profiles-on-windows-7-cant-log-on-with-other-users

  • My problem is too complex for a simple one-line question. Is there an upload facility where I can describe the problem in some detail?

    My Problem with Word and Excel for Ms Office 2011
    I work on a MacBook Pro (Mavericks, v.10.9.1) as an editor of a scholarly journal.
    I regularly receive submissions as Ms Word, Excel and PowerPoint files, mostly created  on Windows computers.
    For the past 10 years I have been using Ms Office software for Mac without any problems to open and process these documents.
    I have since 2012 been using Ms Office 2011 for Mac without without any problems.
    About 10 days ago, I started getting  error messages when trying to open Ms Word and Excel  files, but I have no problems with opening and editing PowerPoint files.
    Failed Clean Reinstallation Attempts
    I completely removed all traces of  Ms Office from every nook and cranny of my Mac, following the procedure  “How to completely remove Office for Mac 2011”  from the MS support website at  http://support.microsoft.com/kb/2398768, and then made a clean reinstallation of Ms Office 2011, followed by two recommended updates.  The problem is back.
    The Error Messages
    When I click on an existing .DOC or .DOCX Word file I get the following error message:
    (1)
    "The Open XML file Normal-dotm cannot be opened because there are problems with the contents or the file might contain characters (for example, \ /)."
    Details
    No error detail available.
    It then lists the name of the document that I was unable to open.
    (2)
    If I click on the image of a Blank page in the Word Document Gallery the following error message is displayed:
    "Word cannot open the existing global template
    (Normal.dotm)."
    (3)
    If I then click on OK, a blank document 1 opens up. When I type information and try to save it I again I get the error message:
    This is not a valid file name. Try one or two of the following:
    *Check the path to make sure it was typed correctly.
    *Select a file from the list of files and folders.
    Workaround Solution by Editing Ms Word Documents Via Pages
    I can open the Word documents that Word cannot in My Mac’s Pages word processing program, and after editing, export them again in Ms Word format, but cannot open the in Ms Word for Mac to see if everything is alright. This is no way to work, using Ms Word.
    Any suggestions how I can solve the problem, sort of buying Ms Office 2013 for Mac?
    (By the way, I am writing this message in Mac’s Notes application).
    <Edited by Host>

    Rembrandt,
    Did the two updates to Office 2011 get you to 14.3.9? That's the latest Mac version of Office.
    I use Office 2013 and Mac Office 2011 on the same machine and have no problems opening any files shared between the two. You followed the instructions for uninstalling and updated your new installation correctly, I have to assume. It sounds as if there is a problem with your cuurent configuration but if it's not an update problem, or an installation problem, I can only direct you to the MS Office for Mac user community -> http://answers.microsoft.com/en-us/mac (sometimes you get lucky and get an actual MS employee answering your question).
    Good luck,
    Clinton

  • Command line question,

    Hi all,
    I am using googlecl to upload a bunch of picture to my picasa account, so far no issue.
    But if i'm using ~/picasa-upload/*.JPG it will upload all but in a random order.
    see outcome below:
    Loading file /home/sweetth/picasa-upload/SDC10825.JPG to album Newcastle
    Loading file /home/sweetth/picasa-upload/SDC10809.JPG to album Newcastle
    Loading file /home/sweetth/picasa-upload/SDC10740.JPG to album Newcastle
    Loading file /home/sweetth/picasa-upload/SDC10781.JPG to album Newcastle
    I want to have them to upload from SDC10655.JPG to SDC10800.JPG
    is there a way to right the commands to do have the upload happening in numerical order?
    Many thanks,

    Allthough ls works ok here, parsing ls output is a bad habit in general because a) the output will differ across implementations, b)  it will cause problems if it's used in a for loop like this, and c) it is often not necessary at all...
    Just loop over a glob in bash:
    for f in *.JPG; do googlecl "$f"; done
    (this will call googlecl for each file individually, not sure if that's what you want)
    Or use find and xargs instead of ls:
    find . -name '*.JPG' -print0 | xargs -0 googlecl
    Last edited by hbekel (2010-11-01 12:58:38)

  • OVM3.0.3 command-line question - how to clone

    Guys,
    I'm trying to do the following:
    take a hot clone every hour of a vm as a sort of backup of the vm
    I haven't noticed any functionality in the manager GUI. I need advise on the command to achieve this.
    Kind regards,
    J
    Edited by: JD on May 4, 2012 5:25 PM

    Have you tried this one: ovmcli-2.2-9.el5.noarch.rpm
    That should provide cli access to the Oracle VM GUI functions, including VM cloning. As a running VM results in a hot clone in OVM 3, maybe this will do th etrick for you. However, the release notes only mention OVM 2.2, but maybe it's worth a shot.

  • Simple command line pdf creation

    I need to create a pdf that is simply combining graphic files in a directory.
    Using VBScript I would like to be able to provide the output pdf name as well as all files to be included.  I have looked but could not find an easy solution.  I also could not find example code.
    I am not opposed to writting C# code to create a program to do this but there must be something out there that does this already.  I have Acrobat available but again no simple solution to provide the output name and input files.
    Lou  

    Would it still be possible to use a powershell script that will open the document. would look like:
    ".\acrobat.exe /A "page=1=OpenActions" "location/of/pdf.pdf"
    and then call an encapsulted javascript to add a premade security policy on the opened pdf? Am i just hoping for to much??
    Would i be able to accomplish something similiar by using the SDK??

  • Another Terminal Command Line Question

    Now that I can successfully connect to my iMac back home vis SSH, I an having problems copying files from it to my iDisk using Terminal. Right now I am using the command, "cp filename.ext idisk_name/directory". When I try that, I get an "Operations not permitted" error. What am I doing wrong?

    Post these queries to the Unix forum under OS X Technologies where Unix and Terminal mavens frolic.

  • Edquota Command Line Question

    Ok. So I can use sudo edquota <username> and access the VIM editor for any user. Once I make changes, how do I apply/save those changes? I've tried typing :q and but they don't seem to apply these changes.
    Also, even after creating group quota files by using the following commands:
    sudo touch /.quota.group
    and
    sudo touch /.quota.ops.group
    I still can't access these groups using the quota editor. Any help?

    :w saves your work in vi. :wq will save and then exit. :q! will quit abandoning changes and :w! will save changes even if the permissions of a file forbid writing (but not if you neither own the file nor are root).
    Did you try edquota -g to edit the group quota?

  • Command line parameters for automator?

    I'm trying to setup a cron job to so that every morning at 8 am "New Mail.workflow" will open and run. I'm able to get it to open but I was wondering if there were command line parameters for Automator that could open AND run a workflow file? Ideally I'd like it to close after running, but I'll worry about that later. Thanks in advance.

    The preferred way is to save your workflow as an application and then call usr/bin/open on it. If for some reason you must have the workflow run inside of Automator (not self-contained) then you're looking at some quality time with man osascript. As it happens Apple has removed even the need for Cron for most users. A click to File -> Save As Plug-In -> for iCal handles it from start to finish.
    Edit: I forgot to mention that Automator has its own simple command line utility for running *.workflow files. Check out man automator

Maybe you are looking for

  • How to change an old email in ichat

    iam trying to change my old email in my ichat but i can not  change it because is asking me i need to call to my Provider to change my emaol and all my information i do not understand how i need  to fix it

  • How do you save a GarageBand project with an iLife Preview?

    I have save with iLife preview checked in GarageBand General settings. The only way I know how is to open iMovie, select the song and press the spacebar, and have it open GarageBand to save it there. the problem with this is that I've edited my songs

  • Is Apex For Me?

    Hello. I am an Epidemiologist at a state department of health, and I am looking for a way to create a web based database where the different laboratories in the state can have someone log in, input data on any positive flu screens, and then have a ch

  • Command to see Switchport Uptime

    I have a port that I believe is going up and down on a 2960X-port switch.  Is there a command that will show information as to how long that port has been in an "up" state?

  • I am trying to access Organizer in Premiere Elements and it just shuts down the programme

    I am trying to access Organizer in Premiere Elements and it just shuts down the programme.  I tried reinstalling the programme but it just does not let me get to Organizer.  Now after reinstalling, it does not let me into the programme.  It just keep