Jump to content

Passing Parameters From Desktop Shortcut To Batch File


Recommended Posts

Posted

Hello All,

need yr help.

Me using Win2K server and i hv created a batch file to run db2 scripts.

In the DB2 scripts, i would need to key in 2 parameters, ie. From_Date and To_Date. Below is the example:-

check_failures 2006-09-01 2006-09-11

The above is working fine in CMD prompt. :D

What i want is to run this script directly from Windows Desktop as a shortcut and let the user key in the dates from Windows itself, ie. the user do not see the command prompt at all. :}

Yr help is much appreciated.

Thanks in advance.


Posted (edited)

You should probably be looking at using vbscript

example.vbs

Dim sh
Set sh = WScript.CreateObject("WScript.Shell")

Dim fromis
fromis = Inputbox("Please enter the 'date from'", "From Date")

Dim uptois
uptois = Inputbox("Please enter the 'date to'", "To Date")

sh.Run "check_failures " & fromis & " " & uptois
Set sh = Nothing

This is a very basic example with no error trapping etc. If you require any further help with this you should post your request in the Programming (C++, Delphi, VB, etc.) forum

Edited by Yzöwl
Posted

Bro,

Thanks a lot. We don't carry programming tools around here, so batch file it is.

Anyway, i hv found out how to handle this:-

set /p dStartDate=Start Date:

set /p dEndDate=End Date:

thanks

Posted
You should probably be looking at using vbscript
We don't carry programming tools around here
Vbscripting is built into your operating system!
Anyway, i hv found out how to handle this:-

set /p dStartDate=Start Date:

set /p dEndDate=End Date:

But you said
What i want is to run this script directly from Windows Desktop as a shortcut and let the user key in the dates from Windows itself, ie. the user do not see the command prompt at all. :}
That not only shows the command prompt, but forces the user to key in dates from the command console, not from the Windows itself!

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...