Send parameters to EXE file by

Posted on 2006-04-09
Last Modified: 2008-01-09
Hello expert ,

i can ran BAT file by this code
<script language="VB" runat ="server">
Sub Page_load(sender as object, E as Eventargs)
        Dim s As New System.Diagnostics.Process
        s.StartInfo.FileName = "d:\myfile.bat"
end sub

but i had 2 questions

1 . how i send some parameters to EXE filev(code it file)

2. how i get parameters in BAT file (code in BAT file)

Question by:sirimit
    LVL 9

    Accepted Solution

    Like this

    1. Use 'Arguments' property of StartInfo to pass the parameters
        s.StartInfo.Arguments="Arg1 Arg2"
    2.  Use %(variable) in batch file- to get the parameters passed
        Echo %1 %2


    Author Comment

    Hello RJ,

    i found new problem

    if i edit test.bat file is  "SHUTDOWN -r -t 01"

    and  aspx file is
            Dim s As New System.Diagnostics.Process
            s.StartInfo.FileName = "d:\test.bat"
    when i call aspx file it not show any error but
    server not restart

    please suggest me

    thank you so much


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Should I Do With This Threat Intelligence?

    Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

    This article was inspired by a question here at Experts Exchange ( The requirements stated in that question are (1) reduce the file size of a large number of…
    Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
    Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
    The viewer will learn how to count occurrences of each item in an array.

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now