Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Ok, I am having the toughest time with this. I need to find all the installs of a program on my network. this is what I have so far. the <computer> variable is for replacing with the real network computer name.
@echo off
IF EXIST "\\<computername>\c$\Program Files\EMGames\EMMedia1-3\dirs\playerwin.exe" GOTO :beerELSE IF GOTO :vodka
:beer
IF EXIST "\\<computername>\c$\program files\emgames\memedia4-6\dirs\playerwin.exe" GOTO :rum
ELSE IF GOTO :whiskey
:vodka
IF EXIST "\\<computername>\c$\program files\emgames\memedia4-6\dirs\playerwin.exe" GOTO :scotch
ELSE IF GOTO :bourbon
:rum
echo <computername>. >>z:\emgames1-6.txt
:whiskey
echo <computername>. >>z:\emgames1-3.txt
:scotch
echo <computername>. >>z:\emgames4-6.txt
:bourbon
echo <computername>. >>z:\emgamesnone.txt

I am sure you do not have angled brackets
around the computer name, right?
After each "echo computername. >>z:\filename"
put a statement called "goto :eof"that should work.
Your exact problem is not clear btw.--
Holla.

I am sorry. I was just frustrated by the time I posted that I could not think straight. when I run it under it's current state against computers I know that have both files that I am looking for. both will show up in the emgames1-3.txt,emgames4-6.txt and the emgamesnone.txt files. so I know my if/else statements are not working right. I am trying to get it so that if the computer has just the 1-3 it shows up in that file if it has just the 4-6 then it shows up in that file. and if it has both then in the 1-6 file it will go. and if there is no emgames on the machine then it should go in the emgamesnone.txt. But it is not working properly. I know that it must be my syntax as I have not tried to write a batch file in many, many years and have forgotten most of it. So any help would be greatly appreciated.
Thanks in advance!

You said it is not working properly.
Is it working improperly? How?
What is not working properly? The whole
batch file or commands within it? Which
commands?
Can you reduce the batch file to just one
single command that is not working and post
the response....--
Holla.

![]() |
![]() |
![]() |

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