Go Back   Computer Forums > General Computing > Server Administration
Click Here to Login
Join Computer forums Today

Thread Tools Search this Thread Display Modes
Old 01-29-2018, 10:55 AM   #1
Baseband Member
Join Date: May 2012
Location: Canada
Posts: 78
Default Why isn't my scheduled task working?


I'm trying to schedule a task in the Task Scheduler on Windows Server 2016. The task is to reset a website in IIS. It's supposed to run every 5 minutes.

Here is the action:

"appcmd.exe" start site /site.name: Default Web Site

This keeps giving me a 0x57 error.

I know that this works because I've verified it:

"appcmd.exe" start site /site.name:testsite

Therefore, it seems to me that the problem is with Default Web Site. I'm guessing appcmd doesn't know how to handle the spaces in the name. I tried this but this doesn't work either:

"appcmd.exe" start site /site.name:"Default Web Site"

Does anyone know how I would set the website to be restarted as the Default Web Site? Thanks.

gib88 is offline   Reply With Quote
Old 02-02-2018, 08:59 AM   #2
Site Team
root's Avatar
Join Date: Mar 2004
Posts: 8,107
Default Re: Why isn't my scheduled task working?

You might want to try putting escape characters in from of the spaces.
appcmd.exe start site /site.name:Default\ Web\ Site
I didn’t fight my way to the top of the food chain to be a vegetarian…
Im sick of people saying 'dont waste paper'. If trees wanted to live, they'd all carry guns.
"The inherent vice of capitalism is the unequal sharing of blessings; The inherent vice of socialism is the equal sharing of miseries."
root is offline   Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

All times are GMT -5. The time now is 02:03 PM.

Powered by vBulletin® Version 3.8.8 Beta 4
Copyright ©2000 - 2020, vBulletin Solutions, Inc.
Search Engine Friendly URLs by vBSEO 3.6.0