Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

task scheduler run cgi script win xp

Status
Not open for further replies.

ibjdt

Programmer
Nov 25, 2002
63
has anyone used the task manager on win xp to execute a cgi script??
i am trying to emulate a cron job -
i.e. run xyz.pl every weekday

i don't understand some of the screens in the wizard and i'm hesitant to continue through it.

my alternative is to put the script in my startup menu.
i don't like this idea because it won't run on days i don't startup the computer.

if i do use the startup method, how do i close the browser window after executing the script??

thanks in advance.
 
It should be no problem, but a CGI script typically is the type of script you see on the internet that you initiate from a web browser. CGI scripts generally have some output they want to print to the screen. If you really are using a CGI script you might need to modify it a little to send it's output to a file. Can you post the script or provide a link to a text copy of the script?
 
i don't like this idea because it won't run on days i don't startup the computer.

Err, even using the Task Scheduler the pc will have to be running...

 
my bad.
i was thinking the task scheduler is a server based thing.
i would set it up from a single cpu within a network and thought it would be controlled by the network server.

looks like that solves the problem for me. i will likely setup the script in my start menu.

anyway, in response to previous posts, the script checks a flat file db where each listing has an expiration date. for each listing that expires within 72 hours, the script emails the originator.

is there a way, if i setup the script in the start menu, to make the browser window close after executing the script??

thanks again.
 
ibjdt-

Depending on the language you are using you may not even need to have a browser window opened in the first place.

For example, if you have a perl script on your local machine and also the perl interpreter then you could just run the perl script from the command line. You could even use the > character to pipe the output to a file if you use a windows shortcut to the perl script.

If the script resides on a server (sounds like it might) then you probably want to just open the url on startup. You could try using a javascript that closes the window, but since the script didnt open the window chances that the browser will allow you to close it are slim.

Can you maybe get the server admin to set the script to run ?

Robert Carpenter
"Disobedience to conscience is voluntary; bad poetry, on the other hand, is usually not made on purpose." - C.S. Lewis (Preface to Paradise Lost)
ô¿ô
 
ibjt,

Can you just confirm what is where in your set-up? You've got this script and a data file, and something to send the emails. Is all that on the server? Is your problem really that you're not able to set up cron jobs on the server, so you have to do it on your PC?

If that's the case, and if you have a web site that gets any traffic at all (one visit a day is enough), you can do what I do on one of my sites...

Write a cgi script that is run as a server-side include every time the home page of your site is visited. The script checks a timestamp file to see if it has been run already today. If it has, it does nothing further. If it hasn't, it calls the check-and-email script and writes a new timestamp.

A proper cron setup would be infinitely preferable of course, but needs must...

-- Chris Hunt
Webmaster & Tragedian
Extra Connections Ltd
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top