Groups | Blog | Home
all groups > inetserver asp db > september 2004 >

inetserver asp db : Executing a command line applications...


Brad Pears
9/28/2004 4:10:22 PM
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 documentation directly on this would be good but any other
docuemtnation on executing a command line "command" would be great!

Thanks,

Brad

Ray Costanzo [MVP]
9/28/2004 4:18:25 PM
Take a look at the .Run method of the WScript.Shell method in the Microsoft
Windows Scripting Host documentation.
(http://www.microsoft.com/downloads/details.aspx?FamilyId=01592C48-207D-4BE1-8A76-1C4099D7BBB9)

Ray at work

[quoted text, click to view]

Brad Pears
9/30/2004 10:34:50 AM
This will work in an ASP script? ( I know nothing about ASP) I am getting
this documetnation 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%23DW0gZpEHA.3392@TK2MSFTNGP15.phx.gbl...
[quoted text, click to view]
(http://www.microsoft.com/downloads/details.aspx?FamilyId=01592C48-207D-4BE1
-8A76-1C4099D7BBB9)
[quoted text, click to view]

Ray Costanzo [MVP]
9/30/2004 10:44:38 AM
yes

[quoted text, click to view]

Brad Pears
9/30/2004 10:54:05 AM
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:e5LaovvpEHA.3524@TK2MSFTNGP15.phx.gbl...
[quoted text, click to view]

Ray Costanzo [MVP]
9/30/2004 11:08:26 AM


[quoted text, click to view]

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


[quoted text, click to view]

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

Brad Pears
9/30/2004 11:47:58 AM
in ASP would you this then...

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

the documentation 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:OVWr78vpEHA.2032@TK2MSFTNGP10.phx.gbl...
[quoted text, click to view]

Ray Costanzo [MVP]
9/30/2004 11:57:24 AM
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

[quoted text, click to view]

Brad Pears
9/30/2004 12:00:37 PM
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:e8dETYwpEHA.3668@TK2MSFTNGP15.phx.gbl...
[quoted text, click to view]

Ray Costanzo [MVP]
9/30/2004 12:13:55 PM
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

[quoted text, click to view]

Brad Pears
9/30/2004 1:24:37 PM
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:OtDghhwpEHA.1816@TK2MSFTNGP09.phx.gbl...
[quoted text, click to view]

Ray Costanzo [MVP]
9/30/2004 1:37:53 PM
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


[quoted text, click to view]

Brad Pears
10/1/2004 12:28:36 PM
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:edDkbQxpEHA.3252@TK2MSFTNGP14.phx.gbl...
[quoted text, click to view]

Ray Costanzo [MVP]
10/1/2004 1:17:36 PM
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

[quoted text, click to view]

Brad Pears
10/1/2004 2:18:55 PM
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:Oyluwp9pEHA.2032@TK2MSFTNGP10.phx.gbl...
[quoted text, click to view]

Ray Costanzo [MVP]
10/1/2004 2:36:44 PM
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

[quoted text, click to view]

Brad Pears
10/1/2004 2:57:38 PM
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:Oyluwp9pEHA.2032@TK2MSFTNGP10.phx.gbl...
[quoted text, click to view]

Ray Costanzo [MVP]
10/1/2004 3:21:58 PM

[quoted text, click to view]

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

Brad Pears
10/1/2004 4:07:36 PM
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%23pEHA.3592@TK2MSFTNGP09.phx.gbl...
[quoted text, click to view]

AddThis Social Bookmark Button