Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Problem with execute program in ASP

Reply
Thread Tools

Problem with execute program in ASP

 
 
DanC
Guest
Posts: n/a
 
      01-06-2005
I try to execute a program in ASP but i get an error.
Even with script below i get 1 as result.
What's wrong?
Pse help, i'm new in ASP.
greets
DanC



<%@ LANGUAGE="JSCript" %>
<%
var WshShell = new ActiveXObject("WScript.Shell");

var oExec = WshShell.run("cmd /C \"ren :\\sss\\back.js
back2.js\"",0,"TRUE");
if (oExec==0)
{
Response.Write("it works!");
}
else
{
Response.Write(oExec);
}

%>



 
Reply With Quote
 
 
 
 
DanC
Guest
Posts: n/a
 
      01-06-2005
Previous code wasn't good. But has nothing to do with the error.

<%@ LANGUAGE="JSCript" %>
<%
var WshShell = new ActiveXObject("WScript.Shell");

var oExec = WshShell.run("cmd /C \"ren c:\\sss\\back.js
back2.js\"",0,"TRUE");
if (oExec==0)
{
Response.Write("it works!");
}
else
{
Response.Write(oExec);
}

%>

 
Reply With Quote
 
 
 
 
Tom Kaminski [MVP]
Guest
Posts: n/a
 
      01-06-2005
"DanC" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> I try to execute a program in ASP but i get an error.
> Even with script below i get 1 as result.
> What's wrong?
> Pse help, i'm new in ASP.
> greets
> DanC
>
>
>
> <%@ LANGUAGE="JSCript" %>
> <%
> var WshShell = new ActiveXObject("WScript.Shell");


see http://www.aspfaq.com/show.asp?id=2059


 
Reply With Quote
 
DanC
Guest
Posts: n/a
 
      01-06-2005
It helped but have now

CScript Error: Loading your settings failed. (access denied)

The used code is now

<% Response.Buffer = true %>
<%
Set objWShell = CreateObject("WScript.Shell")
Set objCmd = objWShell.Exec("\\Dc_test\SSS\cscript.exe
\\Dc_test\SSS\sasysdag.js /?")
strPResult = objCmd.StdOut.Readall()
set objCmd = nothing: Set objWShell = nothing
response.write ".<br>" & replace(strPResult,vbCrLf,"<br>")
%>

It looks like i'm not far of the problem

 
Reply With Quote
 
DanC
Guest
Posts: n/a
 
      01-06-2005


Set objCmd = objWShell.Exec("cscript /?")

what should give the help of cscript, give also
CScript Error: Loading your settings failed. (access denied)


 
Reply With Quote
 
DanC
Guest
Posts: n/a
 
      01-06-2005
It has nothing to do with permissions or exc.
It was a setting in the properties of the website in IIS.
There were only permisions to scripts. And not to scripts and executable
files.

Tnx anyway for reply.
Greets
DanC



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Execute asp.net .exe from classic ASP. UnglueD ASP .Net 2 10-30-2006 10:11 PM
Execute ASP or ASP.Net page or code at specified time interval Grant Ord ASP General 3 05-12-2005 05:34 PM
Can i execute aspx file in my asp pag with server.execute method(sorry) Savas Ates ASP General 1 08-17-2004 04:52 PM
Execute ASP file from ASP file Tomasz Ludwiniak ASP General 3 10-29-2003 11:47 AM
Re: How to execute C program and display output to webpage? John Bokma Perl 5 09-10-2003 06:38 PM



Advertisments