Solved

.bat file command to reboot IIS

Posted on 2004-09-04
3
1,611 Views
Last Modified: 2012-06-27
Hi Experts,

Is it possible to reboot IIS, and, then, as soon as it has rebooted, do something like register a dll, all in a single bat file that I can schedule to run unattended?

Thanks.
0
Comment
Question by:metalaureate
3 Comments
 
LVL 36

Accepted Solution

by:
Zyloch earned 500 total points
Comment Utility
Hi

Try this bat file. Code by Pete Freitag from http://www.cfdev.com/code_samples/code.cfm/CodeID/71/ColdFusion/Bat_file_to_Restart_IIS_Web__FTP__SMTP_Services:

@echo off

REM - File: iisrestart.bat
REM - Description: Restart's IIS (Web, FTP, SMTP)
REM - Author: Pete Freitag CFDEV.COM

REM - ADD REM comments if you don't want to restart any
REM - of Services

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

net stop "World Wide Web Publishing Service"
net start "World Wide Web Publishing Service"

net stop "FTP Publishing Service"
net start "FTP Publishing Service"

net stop "Simple Mail Transport Protocol (SMTP)"
net start "Simple Mail Transport Protocol (SMTP)"

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

echo on



Now, put your own code, like registering dlls, between echo IIS Restarted and echo on

Regards,
Zyloch
0
 
LVL 4

Expert Comment

by:Kaarthick
Comment Utility
A single coommand is enough to restart the IIS.

IISRESET

Open a command prompt and type the above command(IISRESET)

regsvr32 "path\filename.DLL"

The above command can be used to register and unregister DLL's.
0
 

Author Comment

by:metalaureate
Comment Utility
That is indeed better! Thank you.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

What is an ISAPI filter?   •      It's an assembly (.dll file) that can add or change the way IIS works.   •      They can be enabled globally for your web server or on a site-by-site basis.   When the IIS server receives a request, enabling the ISAPI fi…
If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now