Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Pass Parameters

Posted on 2014-01-26
8
Medium Priority
?
251 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 71

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
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

 
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 36

Assisted Solution

by:mccarl
mccarl earned 668 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 71

Assisted Solution

by:Qlemo
Qlemo earned 664 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 46

Accepted Solution

by:
aikimark earned 668 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

This is a little timesaver I have been using for setting up Microsoft Small Business Server (SBS) in the simplest possible way. It may not be appropriate for every customer. However, when you get a situation where the person who owns the server is i…
A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
Windows 8 comes with a dramatically different user interface known as Metro. Notably missing from the new interface is a Start button and Start Menu. Many users do not like it, much preferring the interface of earlier versions — Windows 7, Windows X…
In this video, we discuss why the need for additional vertical screen space has become more important in recent years, namely, due to the transition in the marketplace of 4x3 computer screens to 16x9 and 16x10 screens (so-called widescreen format). …

596 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