Professional Web Applications Themes

Executing a command line applications... - ASP Database

Can someone give me some sample code on how one would go about executing a command line "command" from within an ASP form? We need to run an application called GnuPG which allows us to encrypt an email. Preferably some doentation directly on this would be good but any other docuemtnation on executing a command line "command" would be great! Thanks, Brad...

  1. #1

    Default Executing a command line applications...

    Can someone give me some sample code on how one would go about executing a
    command line "command" from within an ASP form?

    We need to run an application called GnuPG which allows us to encrypt an
    email.

    Preferably some doentation directly on this would be good but any other
    docuemtnation on executing a command line "command" would be great!

    Thanks,

    Brad


    Brad Guest

  2. #2

    Default Re: Executing a command line applications...

    Take a look at the .Run method of the WScript.Shell method in the Microsoft
    Windows Scripting Host doentation.
    (http://www.microsoft.com/downloads/details.aspx?FamilyId=01592C48-207D-4BE1-8A76-1C4099D7BBB9)

    Ray at work

    "Brad Pears" <com> wrote in message
    news:phx.gbl... 


    Ray Guest

  3. #3

    Default Re: Executing a command line applications...

    This will work in an ASP script? ( I know nothing about ASP) I am getting
    this doetnation for someone who only knows a bit more than me!!!

    Thanks,

    Brad
    "Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in
    message news:O%phx.gbl... 
    Microsoft 
    (http://www.microsoft.com/downloads/details.aspx?FamilyId=01592C48-207D-4BE1
    -8A76-1C4099D7BBB9) [/ref]
    a [/ref]
    other 
    >
    >[/ref]


    Brad Guest

  4. #4

    Default Re: Executing a command line applications...

    yes

    "Brad Pears" <com> wrote in message
    news:%phx.gbl... 
    > Microsoft 
    > (http://www.microsoft.com/downloads/details.aspx?FamilyId=01592C48-207D-4BE1
    > -8A76-1C4099D7BBB9) [/ref]
    > a [/ref]
    > other 
    >>
    >>[/ref]
    >
    >[/ref]


    Ray Guest

  5. #5

    Default Re: Executing a command line applications...

    OK, do you have to add a reference somewhere to "wscript.shell" in order to
    use it's methods within an ASP script or will it "just be available"??

    To use this in a VB or Access project, what reference would you add?

    Thanks,

    brad

    "Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in
    message news:phx.gbl... [/ref]
    getting 
    > > Microsoft 
    > >[/ref][/ref]
    (http://www.microsoft.com/downloads/details.aspx?FamilyId=01592C48-207D-4BE1 
    > > a 
    > > other 
    > >
    > >[/ref]
    >
    >[/ref]


    Brad Guest

  6. #6

    Default Re: Executing a command line applications...



    "Brad Pears" <com> wrote in message
    news:phx.gbl... 

    You'd just create the object with CreateObject("WScript.Shell"). The object
    will have its properties and methods available to itself!

     

    Windows Script Host Object Model, I'd imagine. But as this is an ASP group,
    I wouldn't trust this answer as fact.

    Ray at work


    Ray Guest

  7. #7

    Default Re: Executing a command line applications...

    in ASP would you this then...

    set WshShell = CreateObject("Wscript.Shell")
    WshShell.run "some command to run"

    the doentation you pojted me to uses
    "set WshShell = Wscript.CreateObject not just the CreateObject function...

    WHich is correct in ASP?

    Thanks,

    Brad

    "Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in
    message news:phx.gbl... 
    >
    > You'd just create the object with CreateObject("WScript.Shell"). The[/ref]
    object 
    >
    > Windows Script Host Object Model, I'd imagine. But as this is an ASP[/ref]
    group, 


    Brad Guest

  8. #8

    Default Re: Executing a command line applications...

    Yes, just CreateObject. Have you even made an ASP page yet? Instead of
    just talking about the theoreticals, you may find it more helpful to start
    playing with some code in an ASP page.

    Ray at work

    "Brad Pears" <com> wrote in message
    news:%phx.gbl... 
    >>
    >> You'd just create the object with CreateObject("WScript.Shell"). The[/ref]
    > object 
    >>
    >> Windows Script Host Object Model, I'd imagine. But as this is an ASP[/ref]
    > group, 
    >
    >[/ref]


    Ray Guest

  9. #9

    Default Re: Executing a command line applications...

    Yes, our graphic designer already has the page done. We do not have ASP
    here - she can only run it on our providers windows box. I'll will give her
    this test code to see if she can get simehting simply like a "dir" to
    work...

    Thanks,

    Brad

    "Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in
    message news:phx.gbl... [/ref]
    function... [/ref][/ref]
    available"?? 
    > > object 
    > > group, 
    > >
    > >[/ref]
    >
    >[/ref]


    Brad Guest

  10. #10

    Default Re: Executing a command line applications...

    Well, just remember that is ASP, there is no interface to see when you
    execute DIR... You'd have to dump the results to a file on the server and
    read that or read the StdOut of the command... Good luck trying to write
    and debug code without a server to work on there! That's rough! You don't
    have any Windows NT, 2000, or XP Pro machines even? All you have to do is
    install IIS, which comes with those OSes, and there you have ASP support.

    Ray at work

    "Brad Pears" <com> wrote in message
    news:phx.gbl... [/ref]
    > function... [/ref]
    > available"?? 
    >>
    >>[/ref]
    >
    >[/ref]


    Ray Guest

  11. #11

    Default Re: Executing a command line applications...

    Hey, I never knew that!!!

    Yes, we have NT, 2000 and XP... IIS is installed on one of our win2k
    servers. How do I setup a test ASP page???

    Remember, I'm knew to this!

    Thanks,

    Brad

    "Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in
    message news:phx.gbl... 
    don't [/ref][/ref]
    of 
    > > function... [/ref][/ref]
    in 
    > > available"?? [/ref][/ref]
    The [/ref][/ref]
    add? [/ref][/ref]
    ASP 
    > >
    > >[/ref]
    >
    >[/ref]


    Brad Guest

  12. #12

    Default Re: Executing a command line applications...

    Put your asp page in the home directory of your Web site. If you're looking
    for tutorials on things like this, try www.iisfaq.com or results from
    Google. IIS configuration is beyond the scope of this group.

    Ray at work


    "Brad Pears" <com> wrote in message
    news:phx.gbl... 
    > don't [/ref]


    Ray Guest

  13. #13

    Default Re: Executing a command line applications...

    Ray, I am able to run ASP using IIS BUT, are there any freely available
    tools out there I can use to modify ASP pages?

    I was able to downlaod and install a trial version of ASPRunner which
    generates a bunch of ASP pages automatically for you from given DB tables.
    However, if you need to make any mods to them, you need an ASP SDK of some
    sort. We do not have an ASP product installed here. There must be some
    freebie tool out there...

    Thanks,

    Brad


    "Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in
    message news:phx.gbl... 
    looking [/ref][/ref]
    write 
    > > don't [/ref][/ref]
    support. [/ref]
    >
    >[/ref]


    Brad Guest

  14. #14

    Default Re: Executing a command line applications...

    All you need is a text editor. Notepad will do. Personally, I use Textpad.
    Here's a breakdown of some popular editors that people use.
    http://www.aspfaq.com/show.asp?id=2500

    Ray at work

    "Brad Pears" <com> wrote in message
    news:%phx.gbl... 


    Ray Guest

  15. #15

    Default Re: Executing a command line applications...

    So what do I do? Do I just edit the .asp form then?

    Brad

    "Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in
    message news:phx.gbl... 
    Textpad. [/ref]
    tables. [/ref]
    some 
    >
    >[/ref]


    Brad Guest

  16. #16

    Default Re: Executing a command line applications...

    What does one normally do with a text editor? Yes, you open
    C:\Inetpub\wwwroot\yourfile.asp and write your html and ASP code.

    <html>
    <head>
    </head>
    <body>
    Date and time: <%=Now%>
    </body>
    </html>

    Ray at work

    "Brad Pears" <com> wrote in message
    news:us7ZXN%phx.gbl... 
    > Textpad. [/ref]
    > tables. [/ref]
    > some 
    >>
    >>[/ref]
    >
    >[/ref]


    Ray Guest

  17. #17

    Default Re: Executing a command line applications...

    Ok, we have Visual Studio .NET loaded and I was able to open an ASP page
    using that.

    Now I have a direct ASP related question for you ...

    In Access or VB (non web based) if I wanted to edit check the value a user
    is entering into a field, I would place some code on the text field, or on a
    command button somewhere to validate - basic editing we are talking about...
    How do I do this in ASP?? There isn't a "form" per se, so where do I place
    code that I want to run when a user clicks a button or enters data in a
    particular field?

    For instance, If I wanted to do a test, and duplicated a line defining a
    button and give it a different name, I suspect I would then see this new
    buttoin show up on the form when I run the project next time, but how would
    I reference this in the code so that whenever I click it, the code will run?

    Here is a button definition line I added...

    input class=button type=button value="Test" ID="Test1" NAME="Test1"

    How do I reference this so that when it is clicked, the code will run? I am
    used to on click events and such so this is very new to me...

    Thanks,

    Brad

    "Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in
    message news:phx.gbl... 
    Textpad. [/ref]
    tables. [/ref]
    some 
    >
    >[/ref]


    Brad Guest

  18. #18

    Default Re: Executing a command line applications...


    "Brad Pears" <com> wrote in message
    news:eZdv$i%phx.gbl... 

    I suggest you start a new thread for a new question. Otherwise you'll
    probably only get an answer from me instead of getting a handful of answers,
    some of which may be better than mine. :]

    Ray at work


    Ray Guest

  19. #19

    Default Re: Executing a command line applications...

    Good point - thanks Ray I appreciate your help thus far.

    Brad
    "Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in
    message news:eZ1pQv%phx.gbl... 
    >
    > I suggest you start a new thread for a new question. Otherwise you'll
    > probably only get an answer from me instead of getting a handful of[/ref]
    answers, 


    Brad Guest

Similar Threads

  1. RUN/execute a Command-Line command from an ASP page
    By Lucas Cowald in forum ASP.NET Building Controls
    Replies: 1
    Last Post: October 22nd, 04:26 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. Executing a procedure from the cammand line
    By Bruce A. Julseth in forum PHP Development
    Replies: 4
    Last Post: October 14th, 07:20 AM
  4. executing a shell command within a function
    By Svlyp in forum PHP Development
    Replies: 0
    Last Post: August 16th, 12:19 AM
  5. How to list the first 10 lines error from executing command
    By Barry Margolin in forum UNIX Programming
    Replies: 8
    Last Post: July 30th, 10:48 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