How to pass a command line argument to the sequence?

Hi,
My GUI is written in VB.NET. I can read the command line argument in the GUI, using: Me.AxApplicationMgr.CommandLineArguments(). But I don't know how to pass it on to my sequence file which the GUI invokes. How do I read the command line argument from the sequence file?
My purpose, is to have the same basic sequence execute different subsequences depending on starting conditions...
I am using TestStand 3.0 with a VB.NET GUI, on Windows XP.
I'd appreciate any help on the subject.
Alan

Hi Alan,
One obvious way would be to add parameter(s) to the MainSequence and then modify the process model sequence file to use the new parameter(s) in the step "MainSequence Callback"  in either Single Pass or Test UUTs but I wouldn't recommend this approach.
The sequence file to be run via the entry point can be found at "RunState.ProcessModelClient" and the lookup string to the MainSequence would be "RunState.ProcessModelClient.Data.Seq["MainSequence"] or .Seq[0] .
Therefore you could quite easy use the SetVal method to setup a Local variable in the MainSequence of your Sequence File to receive the command line string.
Also you could do this without altering the Process Model Sequence File by using the Callback Sequence ProcessSetup in your Sequence File.
As an example.
You have a string in your Locals of MainSequence called CmdLineStr.
If you add the Callback Sequence ProcessSetup to your SequenceFile, then add an ActiveX Automation Adapter step which is setup for a PropertyObject and the reference is RunState.Caller.RunState.ProcessModel.Data.Seq[0].Locals.CmdLineStr.
There is an extra RunState.Caller to the lookup string, that's because I am doing the work in a SubSequence of Entry Point Sequence.
The method to use is SetValString and the parameters of the PropertyObject will be
lookupString = ""
options = 0 or 1
newValue = where evey you have stored you command line string.
Now when you run your sequence file you will find that the Locals.CmdLineStr will contain your parameter string.
Hope this is of help to you.
Regards
Ray Farmer
Regards
Ray Farmer

Similar Messages

  • How to pass a command line argument to a jsp file...

    Hi guys,
    I'm writing a jsp file in which I have some java codes. I want to pass some command line arguments to that jsp file. In other words, I have some files located somewhere on my C drive and I want to pass the path to these files to my jsp file. How can it be done? I have never done before.
    Any suggestion will be very hepful...
    Thanks....

    I dont know if I truly understand your problem...
    For instance, when you place the url of your jsp you can add, at the end some parameters. For example:
    http://myserver/myapp/myjsp.jsp?MyParameter=C:\Temp\JavaTutorial.html
    In your JSP, you can place this code on a scriplet to get the value:
    String path = request.getParameter("MyParameter");
    Hope it helps.

  • Pass dynamic Command line arguments

    Hi,
    I tried to pass dynamic command line argument to Web start using the method :
    "javaws URL -D foo -D bar"
    as explained in the "Unofficial JWS/JNLP FAQ" that " You can pass your own system properties to your app using -D switch ....", but I got the following error at the start;
    error occurred while launching/running the application.
    Category: Invalid Argument error
    Too many arguments supplied: {http://...URL/my.jnlp, -Did=123 }
    p.s. I already added the"<property name='' value=''/> in the <resourse>, and modified the main class to get the parameter using System. getProperty();
    Did anyone try to this method before? What's wrong of this?
    Thanks in advance for your help.

    Thanks.
    here below is the jnlp file:
    <jnlp spec="1.0+" href="$$name" codebase="$$codebase">
    <information>
    <title>GUI Application</title>
    <vendor>PS</vendor>
    <description>PS GUI WebStart Version</description>
    <icon href="logo.jpg" />
    <offline-allowed />
    </information>
    <resources>
    <j2se version="1.3" />
    <jar href="lib/gui.jar" />
    <property name="id" value="zbc" />
    <jar href="lib/classes12.zip" />
    <jar href="lib/j2ee.jar" />
    <jar href="lib/jaas.jar" />
    <jar href="lib/jce1_2_1.jar" />
    <jar href="lib/jdom.jar" />
    <jar href="lib/xerces.jar" />
    <jar href="lib/local_policy.jar" />
    <jar href="lib/log4j.jar" />
    <jar href="lib/orion.jar" />
    <jar href="lib/sunjce_provider.jar" />
    <jar href="lib/US_export_policy.jar" />
    </resources>
    <security>
    <all-permissions />
    </security>
    <application-desc main-class="GUIFrame">
    </application-desc>
    and in the main class "GUIFrame", i use System.getProperty("id") t get the parameter, if I hardcode the value of the "id" in this jnlp file and use javaws URL, everything's fine, but not the "javaws URL -Did=value" which will return the error as mentioned.
    Thanks again for your help.

  • How to run a command line argument

    i want to run a command line argument, say for eg......i want to execute the "dir" command on the dos prompt and capture the output.
    how can i do this.
    actually i want to capture the output of the ping command and write it to a file. can any body plsssssss help

    This command runs a ping to "address" and writes the output back to the command line. To capture it, just put strings into an array or do whatever you want with it. If you want to wait until the program completes before reading its input, use p.waitFor().
    Process p = Runtime.getRuntime().exec("ping " + address);
    BufferedReader in = new BufferedReader(new InputStreamReader(p.getInputStream()));
    String currLine = null;
    while((currLine = in.readLine()) != null)
      System.out.println("ping: " + currLine);
    [/code                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Passing * as command line argument

    I need to take some arguments from cmd in my java program which need to be of this form:
    java myprogram 4574 10 *
    Everything else works fine but when it comes to the asterisk (*) it is replaced by the file list and the args[] in my program becomes
    4574
    10
    myprogram.class
    myprogram.java
    123.txt
    Now i know that instead of giving * if i give "*" the program would be fine.... but is there any way to pass only * (without quotes) in arguments and get the * character in my args array.

    Compiled with the free command-line Borland compiler and run from cmd:
    #include <stdio.h>
    void main(int argc,char *argv[]) {
    int i;
    for(i=0;i<argc;i++)
    printf("%d [%s]\r\n",i,argv);
    C:\temp\efemer34\xx>a *
    0 [C:\temp\efemer34\xx\a.exe]
    1 [*]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Test Stand: How does parameter's value is passed as command line argument?

    Hi All,
    This is my 1st Q on this board.
    I'm using Test Stand Sequence to call a subsequence where I call an executable file and passing few arguments to it.
    SuperSequence.seq => SubSequence.seq
    In SuperSequence.seq I have 3 parameters and their values are specified
    Parameters
    Name      Type    Value
    ==============================
    Name      string    "Nirvana"
    Address  string    "London"
    Tel           Number "123456"
    In SubSeq.seq I call and EXE with following parameters
    Executable Path Name: myApp.exe
    Argument Expressxion:  "Parameters.Name  Parameters.Address  Parameters.Tel"
    In the application I receive parameter names instead of their values?
    E.g. I recevie Parameters.Name  Parameters.Address  Parameters.Tel in myApp.exe as arguments.
    How do I make the values to be passed to myApp.exe instaed of parameter names?
    Cheers
    Nirvana

    Hi,
    You have to make a string containing the arguments that you require
    Try the following expression
    Parameters.Name  + " " + Parameters.Address + " " +Str( Parameters.Tel)
    Regards
    Ray Farmer
    Regards
    Ray Farmer

  • How to pass command line arguments to Web Start appclient?

    Hi,
    I would like to pass arguments to appclient, but "javaws" unable to do that.
    Do I have to overwrite the JNLP? I use Sun Appserver 9.0, it creates JNLP on the fly!!!
    Please help, thanx!
    MB

    Hi, MB.
    If you are talking about the automatic Java Web Start support for launching app clients in GlassFish, you can pass the equivalent of command line arguments using the query string of the URL you use to launch the app client.
    Briefly, use
    http://host:port/client-path?arg=first-arg&arg=second-arg& ...
    specifying the argument values in the order that you want them passed to the client.
    The GlassFish server will do the right thing and generates the correct JNLP so your arguments are passed to the app client.
    The GlassFish developer's guide http://glassfish.dev.java.net/nonav/javaee5/docs/AS91DG.pdf discusses this and all aspects of the Java Web Start support. You can also take a look at this blog entry http://blogs.sun.com/quinn/entry/command_line_arguments_and_properties that focuses on how to pass arguments.
    Since this technique deals with argument passing in the URL, it works no matter how you launch the app client: a URL in a browser, the javaws command, etc.
    - Tim

  • How to hide the command line arguments from solaris process

    Hi All,
    When I execute a JAR application from a java file using the Runtime.getRuntime, the command line arguments (user ID and Password details) which I passed for executing the application displayed on Solaris process (ps -ef).
    Could anybody please help me, how can I hide either the process or the command line arguments from the Solaris process?
    I cannot pass any asterix or any special character in place of password, because the executing application doesn't have any functionality to retreive the password which send as asterix characters.
    Please help me
    SumodeV

    Thanks for all the response.
    I have created a design and implement the functionality which executes the JAR application in Solaris environment without showing any details in the process details.
    I have used the Java Reflection method, which invokes the JAR application. I am sharing the details here for all those who looking for it.
    1, Inside the Customer application [Jar File is running for it], collect the necessary session details [Using System.get property method]
    2, Create an independent Java file, which should be used to invoke the JAR application
    3, Create the ProcessBuilder object and use a command - execute the Java file [a wrapper code] using normal Java command
    4, Pass the necessary session details to the ProcessBuilder using the environment() function.
    5. Collect the environment values in the independent Java file (Which was invoked by ProcessBuilder) and set details for its environment using System.setProperty.
    6, Use reflection technique to invoke the JAR plugin [which you want to run]. You can use the standard Java functionality to read the MANIFEST file of JAR and load the main class using URLClassLoader.
    7, Invoke the main method of the JAR file, which run the JAR application in Solaris window
    This solution will make sure that the process cannot display any session details in the Solaris Environment.
    Note: Use String[] array while create the command. Otherwise the JAR application cannot pop-up.
    Regards
    Sumode

  • Filenames as Command Line Arguments: How?

    i need to create a program that involves taking in a file name as command line argument, reads the file and then displays its contents on the screen. it needs to work with any file with a .txt extension.
    The only thing i dont fully understand is how to read the file name as a command line argument e.g.
    "java FileReaderApp myfile.txt
    ----contents of file--------
    Thanks in advance
    Carl
    P.S. I have lready read the various helps, utils etc for java and still dont really understand

    Okay, first, it will help if you don't think of "filenames as command line args." The two concepts are totally independent.
    Command line args are Strings. What you do with those Strings is up to you. Processing the command line args is the same, regardless of whether they represent file names or the turnons of the last 50 playmates.
    The args array below contains the command line args.
    public static void main(String[] args) {
    // do stuff
    } Files are generally referred to using the java.io.File. It takes a String for the file name. It doesn't matter where the String comes from.
    Look at FileReader and BufferedReader to actually read the contents of the file.
    http://java.sun.com/j2se/1.4.2/docs/api/java/io/FileReader.html
    http://java.sun.com/j2se/1.4.2/docs/api/java/io/BufferedReader.html
    For the basic command line arg stuff, one of the following should have some info and examples
    http://java.sun.com/docs/books/tutorial/
    http://java.sun.com/learning/new2java/index.html
    http://javaalmanac.com
    http://www.jguru.com
    http://www.javaranch.com
    Bruce Eckel's Thinking in Java
    Joshua Bloch's Effective Java
    Bert Bates and Kathy Sierra's Head First Java

  • How to count Command-Line Arguments ?

    How do you count Command-Line Arguments ?
    For example,
    java program argument1 arguement2
    I would like to be able to count how many arguements the user inputed
    It should result as 2 for the bold line above
    Thank you for your help

    public static void main(String[] args) {
        int numArgs = args.length; // args holds argument1 and argument2
    }

  • [Solved] Assembly - Passing Integer Command Line Parameters

    This is as good a place to ask as any I suppose, so here goes.
    I'm really only interested in knowing if it is at all possible to push actual values, in this case integers, on the stack from the command Line, i.e. passing arguments and if so how, because as far as I can gather, it is simply impossible to pass anything other than strings.
    Yes I am a noob at assembly, if anyone should doubt that.
    Best regards.
    I thought the best thing to do is simply to explain what I'm actually doing.
    In short, I need to derive the Lightness/Luminance level of a pixel. This of course can be done a number of way. Initially I experimented with image magic, but when I couldn't figure it out, I thought: "Hey, why not learn something along the way?"
    So here I an, trying to do some assembly under linux.
    For those interested the process is actually rather sinbple:
    1. get and convert the rgb input as needed.
    2. Determine the highest and lowest channel (progress so far):
    mov ax, $1;
    mov cx, $2;
    mov dx, $3;
    cmp ax, cx;
    jng else;
    mov ax, ax;
    mox bx, cx;
    jmp next;
    else:
    mov ax, cx;
    mov bx, ax;
    next:
    cmp dx, ax;
    jng else2;
    mov ax, dx;
    jmp end;
    else2:
    cmp bx, dx;
    jnl end;
    mov bx, dx
    end:
    3. add the two values and divide by two. possible implement a way to check if the addition is even or not, so to enable proper rounding.
    4. output the result in one form or another.
    Last edited by zacariaz (2012-09-03 20:30:14)

    Lux Perpetua wrote:
    zacariaz wrote:
    Well, at the same time it makes sense and it don't.
    I makes sense to have a "common language", so to speak, so that various applications can be piped together.
    At the same time however, it's a waste to have the majority of the code dedicated to making conversions. First one for the input and then one for the output.
    But that life I guess.
    Thanks for now.
    When you run a program on a Linux system, it ultimately all boils down to the following function:
    int execve(const char *path, char *const argv[], char *const envp[]);
    Without going into full detail: the first argument is the path to the program being executed. The second argument is literally the "argv" argument list the program sees (which is a null-pointer-terminated array of pointers to null-character-terminated strings). The third argument is the environment. Relevant to you is the second argument. It doesn't matter if it's an assembly program, a C program, or a shell script; the "command-line" arguments to the program, i.e., the argv array, are pointers to strings.
    Lest you have the brilliant idea to take an integer apart into bytes and stick them in a string as one of the argument as some others have suggested, you should consider the following: what if one of the bytes of the integer is 0? That technically ends the "string," and everything following that byte is discarded by execve. Adding 1 to all the bytes wouldn't work, since 0xff would wrap around to 0 again. To make it work, you'd need to encode the integer in some other complicated way to avoid null characters and then decode it inside your program. In other words, you might as well just pass an ordinary string and parse it with atoi or strtol.
    You are of course right, and thanks for the very nice explanation, however it's still a pain in the but.
    I like working with number, not with letters, but enough of this.
    Thanks to all and to all a good night, day or whatever you please.
    Best regards

  • Executing another program with command line arguments

    I am very new to Java, so bare with me.
    I have written an encryption/decryption program in C (that accepts command line arguments of the key, mode (encrypt/decrypt), and file), and I have written a GUI for it in Java. It accepts the filename (and has a button which opens the "File/Open" dialog), key, and mode, and has a button to Start the process of the encryption. I'd like for that "Start" button to call my encryption program in C (eep.exe) with the command line arguments of the file, key, and mode. This is what I have written so far :
    Start = new JButton("Start");
    Start.setBounds(150, 180, 90, 25);
    Start.addActionListener(new ActionListener() {     
    public void actionPerformed(ActionEvent ae) {
    Desktop.open(new File("C:\\eep.exe" + " " + filename + " " + mode + " " + key));
    However, I get the error "Cannot make a static reference to the non-static method open(File) from the type Desktop" on the Desktop.open command.
    What should I do? Is Desktop.Open the right way to go about this? If not, what is the right way to go about it?
    Thanks in advance.

    That has helped greatly, but I cannot pass command line arguments to it.
    Using :
    try {
        Desktop.getDesktop().open(new File("C:\\eep.exe"));
    catch (Exception e) {
       System.out.println("Error executing.");
    }I can execute eep.exe, but when I try to pass command line arguments to it, such as
    Desktop.getDesktop().open(new File("C:\\eep.exe" + " " + filename));it fails, get caught and prints "Error Executing."
    I have also tried loading the program, as well as some command line arguments into an array of strings :
    String[] cmdArray = {"C:\\eep.exe", filename};
    Desktop.getDesktop().open(new File(cmdArray));But it gives me the error "The constructor File(String[]) is undefined" on the
    new File (cmdArray)part of the command.

  • Solaris 10 command-line argument to /etc/init.d/apache

    Does anyone know how to control the command-line argument sent to /etc/init.d/apache that ships with Solaris 10 11/06?
    # svcs *\apache\*
    shows Solaris is running Apache 1.3 as a legacy service with the FMRI lrc:/etc/rc3_d/S50apache.
    According to Sun documenation ("How to Modify a Command-Line Argument for an inetd Controlled Service" <http://docs.sun.com/app/docs/doc/817-1985/6mhm8o5ss?a=view>), one should be able to make desired changes using the inetadm command. The problem is,
    # inetadm
    doesn't show anything at all related to apache or httpd. I thought about changing the inittab file, but Sun's comments in the file pretty much say "hands off."
    I'm trying to have Apache SSL enabled at boot time (i.e. argument startssl instead of start). As a temporary hack, I've edited apachectl so that the "start" argument is processed like "startssl."
    Thanks!

    tmilbank wrote:
    Does anyone know how to control the command-line argument sent to /etc/init.d/apache that ships with Solaris 10 11/06?
    # svcs *\apache\*
    shows Solaris is running Apache 1.3 as a legacy service with the FMRI lrc:/etc/rc3_d/S50apache.
    According to Sun documenation ("How to Modify a Command-Line Argument for an inetd Controlled Service" /etc/rc3 services have nothing to do with inetd.
    The script is running from the above file (/etc/rc3.d/S50apache).
    That's normally apache 1.x. If you do 'svcs -a', you'll see disabled services as well, which will include the apache 2.x server.
    <http://docs.sun.com/app/docs/doc/817-1985/6mhm8o5ss?a=view>), one should be able to make desired changes using the inetadm command. The problem is,
    Neither version of apache runs from inetd. Are you interested in apache 1.x or apache 2.x?
    Darren

  • OSDOfflineBitlocker.exe command line arguments ?

    Hi there,
    I'm searching a referencial with the command line argument of the SCCM tools OSDOfflineBitlocker.exe (Pre-provision Bitlocker task in SCCM 2012).
    My purpose is to set the TPM Owner password manually, I don't know if it's possible but I know that the task OSDBitlocker.exe (Enable Bitlocker) can receive arguments like "/enable /wait:False /mode:TPM /pwd:None".
    Thanks

    Pls refer
    http://www.windows-noob.com/forums/index.php?/topic/6451-how-can-i-pre-provision-bitlocker-in-winpe-for-windows-8-deployments-using-configuration-manager-2012-sp1/
    Thanks, Prabha G
    Thanks for the link but I use Bitlocker with MBAM and this method don't save the TPM Owner password in the database and it's not possible to fix it.

  • Burrito - can't set 'command line arguments' (mobile)

    Hi all,
    The option to set command line arguments in the "Run/Debug Settings" - "Launch Configurations" dialog disappears when a new "Flex Mobile AIR Project" is created.
    I am developing APKs that are launched via Intents from other Android apps; setting arguments for testing in the IDE would improve the workflow that now requires me to deploy to the device for testing. Is there a workaround for this?
    Thanks,

    Put the command into a file with execute permissions, including whatever command-line arguments you want. For instance, the file might contain the following:
    #! /bin/bash
    xpdf -g 1200x900 -z width -cont "$1"
    In Firefox preferences, under "Applications," locate the appropriate Content Type and in the Action menu, select "Use other..." and then locate the executable file you just created and select it.
    In UNIX-type operating systems at least, available options to the command can be found using the "man" command (e.g. "man xpdf" for the example above).

Maybe you are looking for

  • AiO Remote iOS app -scanning A4

    I have a Photosmart 5515 All in One printer and have been using the iOS app AiO Remote app to scan in some A4 pages. I set the app to scan to a document and also the page size to A4. Looking at the resultant document it has scaled the the document do

  • How many devices can you have on one account

    We have seven devices and they are on one account. But today we are have a problem with one and trying to buy an in app purchase it says that I need to repurchase this app on the same account it was downloaded I have not changed anything

  • How to capture the selected values of the filter?

    Hi Everybody I have created a dashboard using a 4 column filter. It all works well - no problem. I now need to enhance the functionality of the dashboard which needs the selected values of each of the parameters of the filter. As far as I know, the s

  • Wont open my AIFF Files

    I have some sound clips I would like to edit. They are AIFF, but it won't let me play the clips or add them to the timeline in soundtrack. Any suggestions? -Matt

  • Problem with DIV "clearing both"

    I am in the process of building a template for my website. I have built my Spry menu bar and have designated a div for to become my "editable area." This area to become the editable area is a DIV called "main content." It placed directly following th