How to add a scheduled task .bat file without running cmd.exe

×

Error message

  • Deprecated function: implode(): Passing glue string after array is deprecated. Swap the parameters in drupal_get_feeds() (line 394 of /home4/ccollins/public_html/ccollins/includes/common.inc).
  • Deprecated function: The each() function is deprecated. This message will be suppressed on further calls in menu_set_active_trail() (line 2405 of /home4/ccollins/public_html/ccollins/includes/menu.inc).

So i had to restart IIS every day at 11 pm . I did not want to run the .bat file in a command prompt so i went looking ....
Put the iisrestart.vbs file into a scheduled job .

Details

C:\scripts\iisrestart.bat

\@echo off
REM - File: iisrestart.bat

echo Restarting IIS...
echo ======================================================

net stop W3SVC
net start W3SVC

echo ======================================================
echo IIS Restarted

C:\scripts\iisrestart.vbs


Set WshShell = CreateObject("WScript.Shell" )
WshShell.Run chr(34) & "C:\scripts\iisrestart.bat" & Chr(34), 0
Set WshShell = Nothing