Computing.Net > Forums > Disk Operating System > Pass Parms to Bat file

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Pass Parms to Bat file

Reply to Message Icon

Name: Ron
Date: November 4, 2002 at 16:55:25 Pacific
OS: 98
CPU/Ram: Pentium 256
Comment:

What is the code to use in a bat file to accept 2 paramters passed to it.
Ex: A USER ID and a Password.



Sponsored Link
Ads by Google

Response Number 1
Name: jboy
Date: November 4, 2002 at 17:29:01 Pacific
Reply:

Not sure if I understand your example exactly, but to write replaceable parameters into a batchfile, use the convention %1 %2 %3 and so on, up to %9 if you need that many.


0

Response Number 2
Name: Ron Katz
Date: November 5, 2002 at 04:58:41 Pacific
Reply:

If 2 parameters are being passed, then should the 1st line in the BAT file read as follows:
%1 %2


0

Response Number 3
Name: Secret_Doom
Date: November 5, 2002 at 08:17:59 Pacific
Reply:

Here's a little demo:

@echo off
echo What you've typed to run this batch: %0
echo Your first argument: %1
echo Your second argument: %2

-- Leonardo Pignataro - Secret_Doom --

secret_doom@hotmail.com
www.batch.hpg.com.br


0

Response Number 4
Name: silmara
Date: December 6, 2002 at 11:37:34 Pacific
Reply:

I try run shellExecute(handle,nil,PChar('c:\samibk.bat '),PChar('192.168.2.4 lk123 142hdd C:\SAMIBACK.SQL'),nil,SW_HIDE), and I have a samibk.bat
c:\mysql -h%1 -p%2 -u%3 samidb>%4

But the result is "% is not a valid application Win32 valid" in Win98 but in 2000 and XP it's OK.

What's wrong?

How can I run .bat with parms using shellExecute in Win98/95?


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More


old dos games Expanding memory



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Disk Operating System Forum Home


Sponsored links

Ads by Google


Results for: Pass Parms to Bat file

passing parameters from bat file www.computing.net/answers/dos/passing-parameters-from-bat-file/12517.html

bat file to del file after date www.computing.net/answers/dos/bat-file-to-del-file-after-date/13958.html

Making a .bat file to get input NT www.computing.net/answers/dos/making-a-bat-file-to-get-input-nt/12892.html