Solved

.bat file command to reboot IIS

Posted on 2004-09-04
3
1,622 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

Free NetCrunch network monitor licenses!

Only on Experts-Exchange: Sign-up for a free-trial and we'll send you your permanent license!

Here is what you get: 30 Nodes | Unlimited Sensors | No Time Restrictions | Absolutely FREE!

Act now. This offer ends July 14, 2017.

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…
A phishing scam that claims a recipient’s credit card details have been “suspended” is the latest trend in spoof emails.
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

729 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