Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hello everyone! :)
Excellent forum you guys have here. I am trying to write a batch file here for work so I can check to see which PCs on my work network have a certain program installed. I'm actually checking to see if the SAP program is installed on a system. Since we have about a hundred PCs here I'd also like it to just spit out a text file with all of the PCs on the network that do not have SAP installed.By the way it's installed @
C:\program files\SAP\I'll be continually searching the forums here for more help but will appreciate any insight you can give. This is kind of my first attempt at jump into batch scripting and I hope to learn a lot from it.
Thanks in advance!

Untested:
FOR /F %%a IN ('NET VIEW') DO IF NOT EXIST "%%a\C$\program files\SAP\whatever.exe" @ECHO %%a >> some.txt
You'll need admin powers on all of the PC's.

Wow the board never emailed me when you wrote that. Thank you so much for the push in the right direction Razor! I do not understand the ('NET VIEW') part you have in there, do I put the domain name in there or something?
I have about 100 computers to scan in a certain domain, how do I go about telling it to scan only the computers in that domain?
I ran this on my personal PC and it runs and creates the text file but it just says "There". Is there a way I can get it to spit out ip addresses of PCs that don't have it?

NET VIEW is a command. You can see what it does by opening a Command Prompt and typing it in. It should list all of the computers in your domain.
The FOR loop uses the first word on each line, so you'll have to run the command to see where FOR is getting a There.
do I put the domain name in there or something?
If you want to specify the domain, you'll need to modify the command to ('NET VIEW /DOMAIN:whatever').

![]() |
count lines do action on ...
|
batch file to delete fold...
|

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