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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Windows Scheduler to run VBScript

Status
Not open for further replies.

DonP

IS-IT--Management
Jul 20, 2000
684
US
I'm trying to get a VBScript to run in the Windows 2000 Server Scheduler but so far have been unsuccessful. If I put only the path and script name, it loads into the editor rather than running the script because that's how it is associated. I am unsure of what application actually runs VBScript and do not want to change the associations that are currently in place. It appears to be asp.dll but that is not a scheduler-type application, so I tried cmd:

C:\WINNT\system32\CMD.EXE /c dir > C:\Websites\cgi-bin\clear_temp.asp

It gives no errors but neither does it work - the script does not run. What application should I be using to run scripts this way? If it were Perl or PHP, it would be straight-forward (probably) but with VBScript, I cannot find an application with which to run it!

If this is a duplicate post, I apologize. I thought I posted the question yesterday but couldn't find it today.
Don
don@pc-homepage.com
Experienced in HTML, Perl, VBScript, PWS, IIS and Apache. Run OS/2 Warp 4, BeOS v5 and Windows NT/2000 (only when I have to!)
 
I'm not clear on what you are trying to do.

ASP pages use the extension .asp, and they can be written using VBScript of course, but you can't really "schedule" an ASP page to run. By definition they are an IIS response to to an HTTP request.

Windows desktop scripts are typically run under Windows Script Host. WSH is associated with file extensions such as .vbs, .vbe, .js, .jse, and .wsf - where .wsf is the "standard" file extension these days though the others still work just fine for "old-style" WSH scripts.

If your "VBScript" is a proper desktop script for use via WSH, it should either be a .vbs file or should be packaged into a .wsf file. These schedule just fine under the Windows Scheduler, but will use the default script host you have set up for those files. This can be changed without manually hacking the registry. The default after installation is wscript.

WSH is actually two script hosts: cscript.exe and wscript.exe, for command line and Windows GUI scripts respectively.

To change the default use:[ul][li]cscript //H:cscript - make cscript the default
[li]cscript //H:wscript - make wscript the default[/ul]
You can run these from Start|Run or a command prompt.

When in doubt, read the docs. A good authoritative downloadable .chm is available at:


Take the time to find your way around this Help file. There is simply a wealth of information here.

If indeed you want to "schedule" an ASP page I can't help you. As I said earlier, I'm not sure that makes sense. Perhaps the ASP forum would be helpful.
 
Yes, I am trying to schedule a VBScript to run at a certain time. I knew that it was something that was used by IIS, which is what prompted my original question of which application needed to be used to run them. But based on what you said, I need to somehow convert the VBScript into a .vbs or other desktop type script and then it should work because I believe otherwise that the Scheduler is now set up correctly. I did look at the Microsoft documentation before posting (thanks for the link) but it generally confuses me more than helps! Don
don@pc-homepage.com
Experienced in HTML, Perl, VBScript, PWS, IIS and Apache. Run OS/2 Warp 4, BeOS v5 and Windows NT/2000 (only when I have to!)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top