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
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.
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?
Summary: Hi everyone! I am trying to create a bat file that will install updated Virus Definitions, I have downloaded them and saved them on a CD. I want the bat file to copy the deffinations to the c:\ drive,...
Summary: I start a program with a batch file. I want to insert an if then command, something like if date > 11-31-03 then del c:\filename.exe goto end end if (normal bat file starting) :end ...
Summary: Hello. My problem is exact like the problem "making a .bat file to get input" in DOS\Page 1... BUT it is in NT 4.0. Like the answer from Secret_doom....but like he sayes, "There are other methods to g...