Computing.Net > Forums > Disk Operating System > how to check IIS in a batch file

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

how to check IIS in a batch file

Reply to Message Icon

Name: jazzy
Date: December 15, 2003 at 11:42:14 Pacific
OS: windows 2000
CPU/Ram: pentium 4
Comment:

hi,

is there an easy way to check whether IIS
has been installed and running on a
Windows 2000 machine from a batch file?

tia,
jazzy



Sponsored Link
Ads by Google

Response Number 1
Name: masimar
Date: December 23, 2003 at 09:31:44 Pacific
Reply:

I'm glad you brought that up. I'm not a wiz at "real" batches, but there's are always more than one way to do something. You could use the Sc command (Service Control, I suppose.) XP is loaded with it, but in 2000 it is an option in the resource kit, so it may be more trouble than it's worth.
sc \\%computername% Query IIsAdmin >C:\folder\iisadmin.txt would write the service info, if any, to a text file.
I use freeware utilities that work on multiple platforms. They're tiny, and I don't have to alter anything for multiple Os's.
I wrote a simple batch that does what you want, using Reg.exe, a registry tool, and Pv.exe, a simple part of PrcView.exe.(Process viewer) The two files just go into a folder with the .bat The batch is:
echo Results >C:\folder\iisadmin.txt
echo ------------------>>C:\folder\iisadmin.txt
reg.exe query HKEY_Local_Machine\system\currentcontrolset\services\iisadmin>>C:\folder\iisadmin.txt
echo ------------------>>C:\folder\iisadmin.txt
echo Processing Running
pv inetinfo.exe>>C:\folder\iisadmin.txt

notepad.exe C:\folder\iisadmin.txt

It just queries the registry for the iisadmin service and writes the result to a text file. Then, Pv queries the inetinfo.exe process and writes that to the same file. Results are:
--------------------------
Results
------------------

Listing of [system\currentcontrolset\services\iisadmin]

REG_DWORD Type 32
REG_DWORD Start 2
REG_DWORD ErrorControl 1
EXPAND_SZ ImagePath C:\WINDOWS\System32\inetsrv\inetinfo.exe
REG_SZ DisplayName IIS Admin
MULTI_SZ DependOnService RPCSS;SamSS;
MULTI_SZ DependOnGroup
REG_SZ ObjectName LocalSystem
REG_SZ Description Allows administration of Web and FTP services through the Internet Information Services snap-in
REG_SZ FailureCommand "C:\WINDOWS\System32\iisreset.exe" /fail=%1%
REG_BINARY FailureActions Data to follow:

80510100 01000000 01000000 03000000 64006500 03000000 01000000 03000000 01000000 03000000 01000000
[Security]
[Enum]
----------------

inetinfo.exe 3716

----------------
if it's installed and running. There will be nothing for Process Running if it's not started. If the service doesn't exist, the results are:
----------------
Results
----------------
The system was unable to find the specified registry key.
----------------
I made a self-extracting zip with Ultimate zip, and you can download it here:
ftp://repair.lft.k12.la.us/software/Batches/iisadmin.exe

This is a secure server used in a school system.
I did this on xp, but the info should be the same on 2000. You may have to alter the registry path.

HO HO HO


0
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Disk Operating System Forum Home


Sponsored links

Ads by Google


Results for: how to check IIS in a batch file

want specify enter in a batch file www.computing.net/answers/dos/want-specify-enter-in-a-batch-file/14558.html

length of a string in a batch file www.computing.net/answers/dos/length-of-a-string-in-a-batch-file/13650.html

Set wallpaper using a batch file www.computing.net/answers/dos/set-wallpaper-using-a-batch-file/5906.html