By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,462 Members | 2,308 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,462 IT Pros & Developers. It's quick & easy.

Pass ASP variable to Execute in a .bat file

P: n/a
I'm using ASP to run a batch file. I need to know how to pass a variable to
this .bat file.

Is this possible? I'm using the following code but need to know how to pass
ASP variable.

set wshell = server.createobject("wscript.shell")
wshell.run "c:\file.bat"
set wshell = nothing

Any ideas? Or a work around?

Cory

Jul 19 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Okay, I did use the below code from your web site. I put the variable 'x' in
the .bat file and it did not work.

I am a little slow to catch on... But I cannot quite see how to get a
variable through to this file.bat i.e. x=value1. How can the bat file
recognize the value of x?

set wshell = server.createobject("wscript.shell")
wshell.run "c:\file.bat"
set wshell = nothing

Can you briefly explain?

Thank you,
Cory


"Cory" <co**@agency-online.com> wrote in message
news:es**************@TK2MSFTNGP11.phx.gbl...
I'm using ASP to run a batch file. I need to know how to pass a variable to this .bat file.

Is this possible? I'm using the following code but need to know how to pass ASP variable.

set wshell = server.createobject("wscript.shell")
wshell.run "c:\file.bat"
set wshell = nothing

Any ideas? Or a work around?

Cory

Jul 19 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.