Problem with execute program in ASP

D

DanC

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);
}

%>
 
D

DanC

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);
}

%>
 
D

DanC

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
 
D

DanC

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

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

DanC

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
 

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

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top