• Introducing WebPros Cloud - a fully managed infrastructure platform purpose-built to simplify the deployment of WebPros products !  WebPros Cloud enables you to easily deliver WebPros solutions — without the complexity of managing the infrastructure.
    Join the pilot program today!
  • Support for BIND DNS has been removed from Plesk for Windows due to security and maintenance risks.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS.

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