April 22nd, 2001, 12:29 PM
How to stop a website from the command line?
I have a interesting problem.
A client has a website running on our IIS 4.0 server that he needs to periodically update now & then. The website uses a access (.mdb) file for use as a price list.
If the client simply updates/uploads the file, IIS considers the original file deleted and the website gives a slew of errors when accessing any page that tries to access the DB. (Understandably)
The workaround is to stop the website in IIS 4.0, then update the .mdb file, then restart the website. This is ok as a stop-gap measure, but I would like some way to automate the update process. I'm almost there except for one snag.
Here's what I'm trying to do:
I'm in the midst of writing a batch file that will stop the web site in question, then do a copy & replace, then restart the web site.
I need to know if anyone knows the DOS command line in Windows NT 4.0 for stopping a single web site on a server. The bizzare thing is there seems to be no documentation on Microsoft's web site about this particular topic. (The MS IIS book lists this feature as "Command Line Administrative Scripting".) It's listed as a feature in IIS 4.0 but that's all that's mentioned in the book.
I found a command to shut down the entire web hosting service, but while this would work, it would shut down ALL the sites running on this server, something I'm not willing to do because of the potential for disaster should something go wrong...
Any help or ideas would be appreciated.
April 23rd, 2001, 09:07 PM
well, if i remember correctly, its NET STOP IIS(or whatever the server is.) you will also shut down all web sites. With iis5 you can restart individual sites. YAY!
A+, MCP, MCP+I, MCSA,
MCSE, MCSE2000, MCDBA,
MCT, CCNA, CCNP