Click to See Complete Forum and Search --> : [RESOLVED] How to pass parameter into batch file


ryanlcs
04-14-2008, 10:32 PM
I tried to pass a paramater into a batch file from asp, but just cant get it right.

ASP Code
Set WShell = Server.Createobject("WScript.Shell")
WShell.Run ("E:\html\html.bat '" & strSource1 & "' '" & strDestination1 & "'")
Set WShell = Nothing

html.bat
"C:\file.exe" f, %1, %2, , 1

The "f" is another parameter to pass into.

So, I would expecte parameter 1 would get value from strSource1, but it failed.

Any help is really appreciated.

ryanlcs
04-15-2008, 01:27 AM
Got it solved.

Change the ASP code to this.
Set WShell = Server.Createobject("WScript.Shell")
WShell.Run ("""E:\html\html.bat"" """ & strSource1 & """ """ & strDestination1 & """")
Set WShell = Nothing