Solved

Pass Parameters

Posted on 2014-01-26
8
248 Views
Last Modified: 2014-02-13
I have a windows application where I can to specify the parameters such as Run As of Date, From Date, To Date etc from the run path without opening the application

i.e. if you go to properties, and in the target you specify your parameters.

In my case I have 5 different parameters LSTDAT1,LSTDAT2,LSTDAT3,LSTDAT4,LSTDAT5 to be passed BUT the value is the SAME

LSTDAT1 = '31/12/2013'
LSTDAT2 = '31/12/2013'
LSTDAT3 = '31/12/2013'
LSTDAT4 = '31/12/2013'
LSTDAT5 = '31/12/2013'

My question is how can I enter only one time the date  31/12/2013 and pass it in the path for the five values?

Thank you
Ramzi
0
Comment
Question by:ramziabk
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 Comments
 
LVL 40
ID: 39812266
If the application is a .exe for which you do not have the code, then you have to follow the rules set by the designer of the application. Look at the documentation or contact the vendor.

If this is something that was built in-house and you have the code, then the code can be adapted to take care of the situation.
0
 
LVL 40
ID: 39813664
Too bad, I missed the comment by only a few minutes :-). It seems that my intervention was not appreciated, or maybe not understood, so I will give it a second try.

The parameters expected by an application on a command line are not defined by the operating system. They are defined by each different applications.

If an application expects 5 parameters, there is nothing you can do.

So your only resources is either to look in the documentation or ask the createor of the application if there are differrent ways to pass the parameters than the one you know.

Or find the source code and adapt it to what you want.
0
 
LVL 70

Expert Comment

by:Qlemo
ID: 39813688
I agree to the previous comments. This is something only the designer of that particular application can know. There is no generic method to provide optional parameters to applications, the interpretation of commandline arguments is fully in the realm of the application itself.
0
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 
LVL 77

Expert Comment

by:slightwv (䄆 Netminder)
ID: 39813698
Can you not create a BAT/CMD/PowerShell script or a wrapper program (like a .Net console app) that accepts the ONE parameter then turns around and calls the program with it repeated 5 times?
0
 
LVL 35

Assisted Solution

by:mccarl
mccarl earned 167 total points
ID: 39813706
You could use a batch file to launch your application, eg. say you currently start your application like this... (this is the value in your shortcuts "target")
C:\my_app_folder\my_app 31/12/2013 31/12/2013 31/12/2013 31/12/2013 31/12/2013

Open in new window

Then what you can do is to create a batch file in the same directory as you app, called say my_app_launcher.bat with the following...
@echo off
my_app %1 %1 %1 %1 %1

Open in new window

And then change you shortcut to launch the batch file instead of the application directly, like...
C:\my_app_folder\my_app_launcher 31/12/2013

Open in new window


The %1 in the batch file expands to be the first (and only) parameter passed to the batch file, but gets used multiple times which I believe is what you want.

Note that you need to make sure that the "Start In" directory is correctly set to your apps directory so that the relative reference to "my_app" inside the batch file works correctly. If you can't do that for other reasons, you will need to hard code the full path to my_app inside the batch file.
0
 
LVL 70

Assisted Solution

by:Qlemo
Qlemo earned 166 total points
ID: 39813715
If nothing else helps, and you need to do that more often, then the approach of slightwv is sound. A simple batch file will do:
@echo off
C:\PathTo\YourApplication.exe LSTDAT1 = %1 LSTDAT2 = %1 LSTDAT3 = %1 LSTDAT4 = %1 LSTDAT5 = %1

Open in new window

or whatever the parameter syntax is for that application.
0
 
LVL 45

Accepted Solution

by:
aikimark earned 167 total points
ID: 39814172
@ramziabk

To expand what mccarl posted, you might be able to use the batch file wrapper method that passes up to five different parameters, but repeats the first parameter.
@echo off
my_app %1 %2 %3 %4 %5 %1 %1 %1 %1

Open in new window

0

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

What my article will show is if you ever had to do processing to a listbox without being able to just select all the items in it. My software Visual Studio 2008 crystal report v11 My issue was I wanted to add crystal report to a form and show…
For a while now I'v been searching for a circular progress control, much like the one you get when first starting your Silverlight application. I found a couple that were written in WPF and there were a few written in Silverlight, but all appeared o…
This video Micro Tutorial explains how to clone a hard drive using a commercial software product for Windows systems called Casper from Future Systems Solutions (FSS). Cloning makes an exact, complete copy of one hard disk drive (HDD) onto another d…
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…

732 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question