Solved

.bat file command to reboot IIS

Posted on 2004-09-04
3
1,620 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Today I came across an interesting issue that had me pulling my hair out.  I was troubleshooting a new internal web site which uses integrated security instead of anonymous.  When browsing the site from my laptop, I was able to access it with no iss…
Debug Tools to analyse IIS process: This article focus on taking memory dumps from IIS to determine which code is taking more time and to analyse which calls hangs/causes more CPU usage. To take dumps,download the following. Install1: To st…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

749 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