Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Pass ASP variable to Execute in a .bat file

Reply
Thread Tools

Pass ASP variable to Execute in a .bat file

 
 
Cory
Guest
Posts: n/a
 
      07-09-2003
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



 
Reply With Quote
 
 
 
 
Andy Sutorius
Guest
Posts: n/a
 
 
Reply With Quote
 
 
 
 
Cory
Guest
Posts: n/a
 
      07-09-2003
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" <> wrote in message
news:...
> 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
>
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Variable Input on procedure - pass by value or pass by reference? Reuven VHDL 0 03-19-2009 07:21 PM
Re: Variable Input on procedure - pass by value or pass by reference? Tricky VHDL 0 03-19-2009 03:59 PM
Variable Input on procedure - pass by value or pass by reference? Tricky VHDL 0 03-19-2009 03:58 PM
Can i execute aspx file in my asp pag with server.execute method(sorry) Savas Ates ASP General 1 08-17-2004 04:52 PM
Execute ASP file from ASP file Tomasz Ludwiniak ASP General 3 10-29-2003 11:47 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57