Executing a command line applications...

B

Brad Pears

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
 
B

Brad Pears

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
 
R

Ray Costanzo [MVP]

yes

Brad Pears said:
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
 
B

Brad Pears

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
 
R

Ray Costanzo [MVP]

Brad Pears said:
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"??

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

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

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
 
B

Brad Pears

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
 
R

Ray Costanzo [MVP]

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
 
B

Brad Pears

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
 
R

Ray Costanzo [MVP]

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
 
B

Brad Pears

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
 
R

Ray Costanzo [MVP]

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
 
B

Brad Pears

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
 
R

Ray Costanzo [MVP]

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
 
B

Brad Pears

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
 
R

Ray Costanzo [MVP]

Brad Pears said:
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 ...

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
 
B

Brad Pears

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

Brad
Ray Costanzo said:
Brad Pears said:
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 ...

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top