Grupos de Google ya no admite nuevas publicaciones ni suscripciones de Usenet. El contenido anterior sigue siendo visible.

passing variables to batch file

Visto 6 veces
Saltar al primer mensaje no leído

Lynn

no leída,
31 jul 2005, 7:05:4531/7/05
a
hi,
i need to run a batch file using vbscript.
the contents of the batch file is echo %1 %2

in vbscript i have WshShell.Run "cmd.exe /c c:\run.bat"
how can i pass %1 and %2 from vbscript to run.bat?

thanks


Jerold Schulman

no leída,
31 jul 2005, 7:40:2231/7/05
a

WshShell.Run "cmd.exe /c c:\run.bat Param1 Param2"


WshShell.Run "cmd.exe /c c:\run.bat AAA BBB"

or

p0="cmd.exe /c c:\util\test8.bat"
p1="XYZ"
p2="ABC"
runit=p0 & " " & p1 & " " & p2
WshShell.Run runit

Lynn

no leída,
31 jul 2005, 12:21:1131/7/05
a
any idea why the output is

C:\>echo [object] [object]
[object] [object]

"Jerold Schulman" <Je...@jsiinc.com> wrote in message
news:cgdpe152fh5pgt13q...@4ax.com...

Jerold Schulman

no leída,
1 ago 2005, 7:39:121/8/05
a

Make sure the batch starts with
@echo off

Sean M. Loftus

no leída,
1 ago 2005, 11:29:211/8/05
a
I had a similar problem not too long ago and found this switch that is
available to hold variables for your batch files. I needed it to hold a file
name typed in at the CMD line and run different VB scripts against it in
succession so I didn't have to do them one at a time. You can probably
modify it to your own use.

Search.bat
-------------------------------------------------------------
@color 0B

@set /p userin=Please enter the INPUT file name and path:

cscript UML_SearchScript_EID_DoesExist.VBS %userin%
cscript UML_SearchScript_SAM_DoesExist.VBS %userin%
cscript UML_SearchScript_SID_DoesExist.VBS %userin%
cscript UML_SearchScript_UPN_DoesExist.VBS %userin%

Exit
--------------------------------------------------------------


--
Sean M. Loftus
Enterprise Architect
Loftus Consulting, Inc.
www.LoftusConsulting.com

sean(removeme)@loftus.org

"Lynn" <Marr...@yah00.c0m> wrote in message
news:u74lS$blFH...@TK2MSFTNGP15.phx.gbl...

0 mensajes nuevos