/build/static/layout/Breadcrumb_cap_w.png

scanning additional areas for software

i want to know what PCs are running Spotify on my network. Unfortunately, Spotify does not create an entry in Program files but rather in AppData\Roaming. Is there any way to create a custom inventory rule to scan that area and if a word is found (like spotify) have that appear in the inventory?


0 Comments   [ + ] Show comments

Answers (5)

Posted by: dkurz8814 11 years ago
Fourth Degree Green Belt
2

so i found the location of the program folder

 

C:\Users\xxxx\AppData\Roaming\Spotify

and I ran a test on my own machine and was able to get it to detect mine but thats only because I put the location as mine. What do i need to do to make the "xxx" be all user profiles?


Comments:
  • Will %username% work there? - dugullett 11 years ago
  • i will try and report back.. - dkurz8814 11 years ago
  • so far changing that to %username% has not worked ( did a forced inventory update on a few machines i know the rule to be true and so far the software is not reflecting those changes, nor is the inventory item being changed in any way) - dkurz8814 11 years ago
Posted by: dugullett 11 years ago
Red Belt
2

I use a recursive lookup .bat for items like this. I've never tested in %appdata%, but you should be able to tweak it. Just export the results to a .txt file and have Kace inventory it.

PUSHD "%appdata%\"

FOR /f "tokens=1-8 delims=\" %%a IN ('DIR /b /s "FIRST.EXE"') DO ECHO %%a\%%b\%%c\%%d\%%e\%%f\%%g\%%h

POPD

PUSHD "%appdata%\"

FOR /f "tokens=1-8 delims=\" %%a IN ('DIR /b /s "SECOND.EXE"') DO ECHO %%a\%%b\%%c\%%d\%%e\%%f\%%g\%%h

POPD

PUSHD "%appdata%\"

FOR /f "tokens=1-8 delims=\" %%a IN ('DIR /b /s "THIRD.EXE"') DO ECHO %%a\%%b\%%c\%%d\%%e\%%f\%%g\%%h

POPD
 
Posted by: j1e0 11 years ago
White Belt
2

Custom inventory rules will look for a file and find it. However, programs such as spotify and dropbox tend to only reside in the users profile.  Therefore when a different user logs in that does not have the program installed the inventory rule will not find it.  I wrote the following script to create a txt document if "spotify.exe" is found anywhere within "documents and settings".  If it is removed, the txt document will be deleted.  Just set the custom inventory rule use FileExists(c:\windows\temp\spotdetected.txt)

@echo off
dir "c:\documents and settings" /s /b | find /i "spotify.exe" > c:\windows\temp\lookingforspot.txt
Find /n /i "spotify" c:\windows\temp\lookingforspot.txt
IF errorlevel 1 goto notfound
echo found > c:\windows\temp\spotdetected.txt
goto end
:notfound
if exist c:\windows\temp\spotdetected.txt del c:\windows\temp\spotdetected.txt
if exist c:\windows\temp\lookingforspot.txt del c:\windows\temp\lookingforspot.txt
:end

 

IF you want this .bat to run completely silent call it using this .vbs script

Set WshShell = CreateObject("WScript.Shell")
cmds=WshShell.RUN("c:\windows\temp\findspot.bat", 0, True)
Set WshShell = Nothing
Posted by: nshah 11 years ago
Red Belt
1

You could also use the Metering aspect of the KBOX and see if anyone is running the spotify executable. That will tell you if anyone on your network is using the application. 


Comments:
  • Unfortunately that just tells me who is currently running it. I want to know where it is installed-regardless of whether or not it is running. I am going to keep playing with the custom inventory rules since I was able to get it to detect my machine , so i know it can look there-its just a matter of finding out what variable I need to use.. - dkurz8814 11 years ago
Posted by: dmaximoff 11 years ago
Purple Belt
1

Try this custom inventory rule then force your client to check in.  After that go into the machine inventory and you should see it listed under Software -> Custom Inventory Fields.  If you see that, look under "Installed Programs"

FileInfoReturn(c:\spotify\spotify.exe, modification_time, DATE)


Comments:
  • good news it found 4 people-bad news is it seems to also be finding false positives. Can I ask you to confirm how I interpret your code?

    You are asking it to return file data from the directory C:\spotify\spotify.exe?

    I am not a script guy so i am kind of a bit in the dark here and I am confused because spotify does not create such a directory.

    everyone's help has been greatly appreciated. - dkurz8814 11 years ago
  • You are correct, in my example it is looking at the directory "c:\spotify". Change the path in the example to the exact path that spotify.exe is located.
    I'm not sure how it would have false positives. What kind of information is it returning in this case?

    Here's a breakdown of the custom inventory rule. "FileInfoReturn" specifies to look for a file and return results back to the K1000. "c:\spotify\" is the directory to look in and "spotify.exe" is of course the file to look for. The last two items are what info to return to the K1000.

    Hope this helps - dmaximoff 11 years ago

Don't be a Stranger!

Sign up today to participate, stay informed, earn points and establish a reputation for yourself!

Sign up! or login

Share

 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ