Di che stai parlando?
Certo la tecnologia ASP è Active Server Page e dal client tu esegui programmi sul server che danno risposte al client....
forse non ero chiaro?
lui vuole cancellare cartelle dal server mi pare e invece lo fa in locale con vbs da una finestra command cosi.... ma questo forum è per ASP mi pare non per pc locale, se no ho ragione io
guarda ti posto il mio schedulatore ASP che ho scritto io e magari lo puo uyilizzare anche lui se ci studia sopra
codice:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<%
dim scriptname,ore,minuti,param,crsx
crsx="onFocus=""this.style.backgroundColor='#8AF4F4'"" onBlur=""this.style.backgroundColor='#FFFFFF'"""
for i=1 to Request.Form("scriptname").Count
scriptname = Request.Form("scriptname")(i)
next
for i=1 to Request.Form("param").Count
param = Request.Form("param")(i)
next
for i=1 to Request.Form("minuti").Count
minuti = Request.Form("minuti")(i)
next
for i=1 to Request.Form("ore").Count
ore = Request.Form("ore")(i)
next
%>
<html>
<head>
<title>Schedulatore script ASP</title>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
<SCRIPT LANGUAGE="Javascript">
var myVar,myVar2;
myVar2 = setInterval(myTimer2, 1000);
myTimer2();
// 1.chiusura pgm e ritorno a menu ... se il modulo è chiamato da fancybox la chiude
// 2.se chiamata da windows open la chiude
// la chiusura del modulo non funziona se attivata direttamente da browser e rimane aperta nel browser
// chiama la pagina menu
// impostare il tipo di chiamata per l'attivazione del modulo
function ReturnBack() {
// parent.$.fancybox.close();
// self.close();
// var x=location.origin;
// location.href=x;
location.href="menu.asp";
}
function StartScheduler(){
if (document.getElementById("scriptname").value!="") {
myVar = setInterval(myTimer, 60000);
document.getElementById("stat").innerHTML = "STARTED";
document.getElementById("rstat").style="background-color: green;color:white;";
}
else
{
alert("DEVI IMPOSTARE UNO SCRIPT DA ESEGUIRE! ...");
document.getElementById("scriptname").focus();
}
}
function myTimer() {
var d = new Date();
var t = d.toLocaleTimeString();
//document.getElementById("sched").innerHTML = t;
EseguiCMD(t);
}
function myTimer2() {
var d = new Date();
var dt = d.toLocaleTimeString();
document.getElementById("sched").innerHTML = dt;
}
function StopScheduler() {
clearInterval(myVar);
document.getElementById("stat").innerHTML = "STOPPED";
document.getElementById("rstat").style="background-color: red;color:white;";
}
function EseguiCMD(t) {
var scriptname,param,ore,minuti;
// controlla ora e minuti per verificare se eseguire il comando
ore=parseInt(document.getElementById("ore").value);
minuti=parseInt(document.getElementById("minuti").value);
// alert(ore+":"+minuti);
if ((ore==parseInt(t.substr(0,2)))&&(minuti==parseInt(t.substr(3,2))))
{
// alert("START CMD");
scriptname = document.getElementById("scriptname").value;
param = document.getElementById("param").value;
StopScheduler();
document.getElementById("msg").value = " Start esecuzione "+t;
EsecuzioneScript(scriptname,param);
}
}
function EsecuzioneScript(scriptname,param) {
// lo script chiamato deve ritornare
// lo status di esecuzione con response.write(...msg...)
// quando ha terminato il lavoro
var P1="?";
if (param=="") {P1="";}
var xhttp = new XMLHttpRequest();
var ris;
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
ris=this.responseText;
document.getElementById("msg").value = ris;
StartScheduler();
}
};
//
xhttp.open("GET",scriptname+P1+param, true);
xhttp.send();
}
function SetTimer() {
var d = new Date();
var t = d.toLocaleTimeString();
// alert("["+t+"]");
var cc=document.getElementById("ore");
for(var i=0;i<cc.options.length;i++){
if(cc.options[i].value == t.substr(0,2)){
cc.options[i].selected=true
}
}
var mm=document.getElementById("minuti");
for(var i=0;i<mm.options.length;i++){
if(mm.options[i].value == t.substr(3,2)){
mm.options[i].selected=true
}
}
}
</SCRIPT>
<style>
.P800 {
width:800px;
height:530px;
margin:auto;
background-color: #e0e0e0;
}
body {
background-color: #cccccc;
background-image:url('images/mercatini_usato.jpg');
background-repeat:no-repeat;
background-position:center;
}
.header {
width:794px;
height:32px;
background-color: #8DC5E2;
color:#0000FF;
border: outset 2px;
font-size: 20px;
margin: 5px;
padding: 5px;
text-align:center;
margin:auto;
box-shadow: 5px 5px 5px #0000ff;
}
.btn {
width:200px;
height:40px;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 14px;
color: blue;
font-weight: bold;
cursor:pointer;
border-radius: 9px;
-moz-border-radius: 6px; /* firefox */
-webkit-border-radius: 6px; /* safari, chrome */
}
.btn:hover {
background-color: orange;
}
.text {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 14px;
color: blue;
}
.text1 {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 16px;
font-weight:bold;
color: white;
}
.note {
background-color: #FEFEFE;
width:98%;
margin:auto;
}
.border-rounded {
border-radius: 6px;
-moz-border-radius: 6px; /* firefox */
-webkit-border-radius: 6px; /* safari, chrome */
}
.main {
margin:auto;
width:90%;
margin:auto;
}
</style>
</head>
<body >
<div class="P800">
<table border="0" cellspacing="3" cellpadding="5" width="100%" class="header">
<tr width="100%">
<td width="768px" align="center">
<b><h3>SCHEDULATORE ESECUZIONE SCRIPT</h3></b>
</td>
<td width="200px"><font size="1">script a cura di V.Manarolla 2019</font>
<img src="icons/homepage.gif" alt="" ondblclick="ReturnBack()"
title="ritorna alla homepage..." style="cursor:pointer;" />
</td>
</tr>
</table>
<br>
<p class="note">Impostare lo script da eseguire giornalmente sul server; i parametri devono essere impostati nella forma
variabile=valore in cui variabile è il nome del parametro da passare al sottoprogramma, nel caso di più variabili
devi usare il carattere "&" per aggiungere altre variabili. Nel caso non ci siano variabili da passare al sottoprogramma
non inserire nulla nel campo parametri
<br>
<div class="main">
<p class="text" style="font-size:16px">ORARIO DI ESECUZIONE PROGRAMMA AJAX ASINCRONO:
<select id="ore" size=1 class="text" >
<% for i=0 to 23
sel=""
if ore=i then
sel="selected "
end if%>
<option value="<%=i%>" <%=sel%> ><%=right("00"&i,2)%> </option>
<% next %>
</select>:
<select id="minuti" size=1 class="text" >
<% for i=1 to 59
sel=""
if minuti=i then
sel="selected "
end if%>
<option value="<%=i%>" <%=sel%> ><%=right("00"&i,2)%> </option>
<% next %>
</select> <button onclick="SetTimer()" width="200px" title="Imposta il timer all'orario attuale..."
class="btn" style="width:120px" >Set timer </button>
</p>
<p>
<center>
<table width="50%" height="40px" border="1" bgcolor="#F9f9f9">
<tr>
<td width="150px" align="center">
<div align="center">
TIME
</div>
</td>
<td width="150px" align="center">
<div id="sched" class="text" >STOPPED</div>
</td>
<td width="150px" align="center" id="rstat">
<div id="stat" class="text1" >STOPPED</div>
</td>
</tr>
</table>
</center>
<br>
<br>
<table border="0" cellspacing="3" cellpadding="5" >
<tr>
<td width="200px" align="right" class="text" >
SCRIPT NAME:
</td>
<td width="200px">
<input id="scriptname" value="<%=scriptname%>" size=50 class="text" <%=crsx%> />
</td>
</tr>
<tr>
<td width="200px" align="right" class="text" />
PARAMETERS;
</td>
<td width="200px">
<input id="param" value="<%=param%>" size=50 class="text" <%=crsx%> />
</td>
</tr>
<tr>
<td align="right" class="text" >
STATUS ESECUZIONE:
</td>
<td >
<input id="msg" value="<%=msg%>" size=50 class="text" readonly="true"/>
</td>
</tr>
<tr>
<td >
<button onclick="StartScheduler()" width="200px" class="btn" >Start scheduler</button>
</td>
<td width="200px" align="right">
<button onclick="StopScheduler()" width="200px" class="btn" >Stop scheduler</button>
</td>
</tr>
</table>
</div>
</div>
</body>
</html>
ciao