I want to run a batch file from with in ASP.NET (aspx.vb file)
and also i want to pass a parameter to the batch file.
Do anyone know how to do this ?
Dim myprocess As System.Diagnostics.Process = New
System.Diagnostics.Process()
myprocess.StartInfo.FileName = "c:\mybat.bat"
myprocess.StartInfo.WorkingDirectory = "C:\"
myprocess.StartInfo.Arguments= " file.txt -s -m"
myprocess.Start()
--
I hope this helps,
Steve C. Orr, MCSD
http://Steve.Orr.net
"Ajit" <adeo...@thedebtmediator.com> wrote in message
news:%230KeGZ3...@TK2MSFTNGP11.phx.gbl...
thanx for your suggession the good thing is it don't give any error but
neither it runs the batch file.
My batch file is Test.bat as below
=======================
@echo off
xcopy %1 "\\ServerName\Users\All\"
And ASP.Net code is
===============
'Run a Batch file
Dim proc As System.Diagnostics.Process = New
System.Diagnostics.Process()
proc.StartInfo.FileName = "C:\test.bat"
proc.StartInfo.WorkingDirectory = "C:\"
proc.StartInfo.Arguments = strFileName
proc.Start()
'proc.WaitForExit()
but in the target folder (\\servername\users\all\) i don't have the copy of
strfilename which is always dynamically generated.
thanx once again
Ajit.
"Steve C. Orr, MCSD" <St...@Orr.net> wrote in message
news:u72O3k3D...@TK2MSFTNGP10.phx.gbl...
--
I hope this helps,
Steve C. Orr, MCSD
http://Steve.Orr.net
"Ajit" <adeo...@thedebtmediator.com> wrote in message
news:%2395O2N4...@TK2MSFTNGP11.phx.gbl...