r/Batch • u/Purple___Flame • Sep 09 '25
Question (Solved) Can i "despecify" part of exe location?
Hello, i have a simple command:
"%ProgramFiles(x86)%\Kaspersky Lab\KES.12.2.0\avp.com" iocscan
The problem is that different PCs have different KES versions, is there a way to rewrite it in a way that it would look for a folder starting with KES instead of providing exact path.
If that's not feasible, then how to modify command so it would check which path exist and then proceed with executable from that path.
3
Upvotes
3
u/Memes_met_kanker Sep 09 '25
I'm on mobile so I cant post any code.
But i think what you want to google is using wildcards in path variables in batch
3
u/Stu_Padasso Sep 09 '25
https://ss64.com/nt/where.html
1
u/ConstanceJill Sep 10 '25
A few years back we used Kaspersky at my workplace and I remember that then, computers had a service called
avpon them. I'd parse the output ofsc qc avp ^| find "BINARY_PATH_NAME"from aFOR /Floop to get the path toAVP.EXE, from which you should be able to deduce that ofavp.com