I'm running this code in a batch file, and trying to do an inventory.
for %%a in ( C D E F ) do if exist "%%a\Program Files\App Path\MyApp.exe" set drive1=%%a
if not [%drive1%]==[%drive1%] echo MyApp is installed ~ %computername% ~ %DATE:~4,10% ~ %time:~0,8% > "\\192.168.x.xxx\ShareName\%COMPUTERNAME%_MyAppInstalled.txt"
The app I'm looking for could be on any of 4 drives so what I'm trying to do is see if the app exists. Then if it does I just want to write that to a file. If it doesn't I don't want anything written. I actually don't care about the drive it is on.
The problem is that if the %drive1%
it doesn't compare correctly.