• Inviting everyone who uses WordPress management tools in Plesk
    The Plesk team is conducting a 60-minute research session that includes an interview and a moderated usability test.
    To participate, please use this link .
    Your experience will help shape product decisions and ensure the tools better support real-world use cases.

running ASP via scheduler

P

parser

Guest
How can i run asp file via scheduler?
when i try
D:\vhosts\vhosts\domain.com\httpdocs\aspfile.asp
is not run,
anybody?

Thanks
David
 
this sounds interesting for me too!
also with .net files (aspx).

Is it possible? and if so how?

Saludos
Pat
 
Asp scripts and scheduler

Yes it is possible with a trick.

You can trigger whatever script you want, even if it is no local, with the following code in php:
PHP:
if ($_GET['password']=='whatever')	{	
$CR = curl_init();					
curl_setopt($CR, CURLOPT_URL, "http://www.domain_name.com/what_ever_script.asp?parameter1=".$_GET['parameter1']);	
curl_setopt($CR, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($CR, CURLOPT_TIMEOUT, 60);
curl_setopt($CR, CURLOPT_POST, 1);
curl_setopt($CR, CURLOPT_POSTFIELDS, "parameter2=".$_GET['parameter2']);
curl_setopt($CR, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($CR, CURLOPT_SSL_VERIFYPEER, 0);
	
$result = curl_exec( $CR );
$error = curl_error( $CR );
	
if( !empty( $error )) {
curl_close( $CR );
echo 'Error:'.$error;
}
curl_close( $CR );
echo 'Ok:'.$result ;
}
Save the previous code as cronJob.php
At scheduler you define the following:

Script path:
c:\program files\swsoft\additional\php\php.exe
(or wherever the php.exe file at your plesk installation is...)

Parameters:
c:\full_server_path_to_file\cronJob.php password=whatever parameter1=value1 parameter2=value2part1+value2part2

Note that:
- Parameters are passed without being splitted with the & symbol (we use spaces instead), and each value must contain the + symbol in case of spaces
- php handles each parameter as a GET parameter
- you can pass parameters to the final script both through POST and GET methods.

CIao.
 
Back
Top