I have a script that I run on all pc's that I image and it basically looks and tells me if a program is installed and if so, what version. When I run my command in a CMD window it works. But as part of my script, it deletes everything in the txt file and adds weird characters. Here is the Edge code.
:Edge
If exist "C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe" (
echo Edge is installed >> C:\Temp\Message.txt
SET "EDGE=Y"
wmic /OUTPUT:"C:\Temp\Message.txt" datafile where 'name="C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe"' get version
) Else (
SET "EDGE=N"&echo Edge is Not installed >> C:\Temp\Message.txt
)
Here is the result Version 94.0.992.50 ?????????????4???????????????????????????????????????????????????????????
I am at a loss.....