I am trying to restore a database on a regular basis. Is there a way to stop and start the IIS server using a command prompt. I want to schedule this event. Thanks for the help in advance. Irene
You can also use: NET STOP "World Wide Web Publishing Service" and then NET START "World Wide Web Publishing Service" or NET STOP "W3SVC" and then NET START "W3SVC"
Hi Irene, Here's the method that I follow whenever I need to restart IIS. Open a new text file from notepad. type the following commands in the text file
net stop w3svc net stop iisadmin net start iisadmin net start w3svc
Save the file as RestartIIS.bat on to your desktop. whenever you want to restart your IIS...just double click the RestartIIS.bat on ur desktop. bingo.....
iisreset.exe is the best choice since it's built especially for this purpose... iisreset /start iisreset /stop iisreset /restart If you're create a kind of windows service which automatically performs this task, consider to use the built-in classes of the .NET
Framework (i.e. the ServiceController class) to stop/start the IIS services. Little question... Why do you want to restart IIS on a regular basis? If you need to do this, it's better to look for the real reason why this is needed (for example, misconfiguration).
If it's a problem of recycling worker processes etc, take a look at IIS 6 which is shipped in Windows Server 2003. By using IIS 6, you don't need to restart IIS anymore for this simple tasks, since you can configure IIS to recycle etc the processes itself.
None
0 Points
18 Posts
Is there a way to stop and start the IIS server from command prompt
Aug 16, 2003 10:04 PM|MultiTasking|LINK
Member
184 Points
1240 Posts
Re: Is there a way to stop and start the IIS server from command prompt
Aug 16, 2003 10:06 PM|NetProfit|LINK
Member
151 Points
4631 Posts
Re: Is there a way to stop and start the IIS server from command prompt
Aug 16, 2003 11:19 PM|douglas.reilly|LINK
Programming Microsoft Web Forms
My Blog
None
0 Points
457 Posts
Re: Is there a way to stop and start the IIS server from command prompt
Aug 22, 2003 01:51 PM|venumg|LINK
net stop w3svc net stop iisadmin net start iisadmin net start w3svc
Save the file as RestartIIS.bat on to your desktop. whenever you want to restart your IIS...just double click the RestartIIS.bat on ur desktop. bingo.....Cheers,
Venugopal Mallarapu.
Visit : My Blog
None
0 Points
1617 Posts
Re: Is there a way to stop and start the IIS server from command prompt
Aug 22, 2003 03:52 PM|bdesmet|LINK
Visit www.msdn.be, www.bartdesmet.net
Member
318 Points
623 Posts
Re: Is there a way to stop and start the IIS server from command prompt
Aug 26, 2003 10:40 AM|gsuttie2002|LINK
MCSD, MCAD, MCSD.Net
None
0 Points
1 Post
Re: Is there a way to stop and start the IIS server from command prompt
Apr 02, 2008 06:34 PM|dallaspartners.com|LINK
I know it's old school, but if you turn this into a .bat file and schedule it to run, you can restart IIS and SQL server + SQL Agent everynight:
@echo off
REM - File: iisrestart.bat
echo Restarting IIS...
echo ======================================================
net stop W3SVC
net start W3SVC
echo ======================================================
echo IIS Restarted
echo Restarting SQL...
echo ======================================================
net stop "SQL Server Agent (MSSQLSERVER)"
net stop MSSQLSERVER
net start MSSQLSERVER
net start "SQL Server Agent (MSSQLSERVER)"
echo ======================================================
echo SQL Restarted
None
0 Points
8 Posts
Re: Is there a way to stop and start the IIS server from command prompt
Oct 09, 2014 03:50 AM|arueru|LINK
Open Command prompt with Run as Administrator and use the below command
iisreset
this command stops and after Start the IIS, for this you can create a .bat file and add Create a task in Task scheduler.
Contributor
5231 Points
1602 Posts
Re: Is there a way to stop and start the IIS server from command prompt
Oct 17, 2014 03:54 AM|necro_mancer|LINK
two whumbs up to arueru post
I agree that you can create a .bat file to restart the IIS