Solved

.bat file command to reboot IIS

Posted on 2004-09-04
3
1,614 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
ID: 11982791
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
ID: 11990844
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
ID: 12007872
That is indeed better! Thank you.
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Kerberos / NTLM 3 64
Use System DSN 6 83
IIS 404 Error on website Automatic Redirect to /help 5 49
Sharepoint 2010 Product Configuration Wizard fails 4 42
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…
Running classic asp applications under Windows Server 2008 R2 (x64) and IIS 7 is not as easy as one may think. It took me a while to figure it out while getting error 8002801d a few times. After you install the OS you will need to install the fol…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.
Need to grow your business through quality cloud solutions? With everything required to build a cloud platform and solution, you may feel like the distance between you and the cloud is quite long. Help is here. Spend some time learning about the Con…

914 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

12 Experts available now in Live!

Get 1:1 Help Now