How do I filter out an error spamming in adb logcat in command prompt? - adb

When I test my VR video playing app, there is always an error spamming when I play a video:
OPENGL NATIVE PLUG-IN ERROR: GL_INVALID_ENUM: enum argument out of range
I can't find anything to fix this error but it does not affect how my app works. However, when I try to debug something, this error keeps spamming and it's hard for me to look at other messages when this happens. I tried to do some research and found that findstr /v may be able to filter out things. So I tried to do these:
adb logcat -s Unity | findstr /v OPENGL
or
adb logcat -s Unity | findstr /v /c:"OPENGL NATIVE PLUG-IN ERROR: GL_INVALID_ENUM: enum argument out of range"
Both seem not able to remove the specific error lines. Am I doing something wrong?

Finally figured it out:
adb logcat -s Unity | findstr /r/c:"Unity : [^ ]" | find /v "OPENGL" | find /v "GfxDeviceGLES.cpp"
findstr /v did not work so well with logcat so instead of filtering out using /v, we use /r to get lines that are not blank, and then filter out those error lines with find /v.

Related

How to match exact string from text file in Batch?

Text file content :
{"progress":"30","type":"info","message":"Retrieving site specific
information from management
system."},"2":{"progress":"2","type":"info","message":"Auto
Installation
initiated."},"5":{"progress":"20.25","type":"info","message":"Checking
connectivity to Internet and management
system."}},"install_progress":0,"logFileName":"FWF_2018-4-5_12_58_57.log"},"token":"gDDJ7uZx"}
Matching String : Auto Install is completed
I am using this code :
findstr /c "Auto Install is completed" "test.txt"
if %errorlevel%==0 (
echo ERROR:Auto Install is completed!
SET vaildJSONData=0
)
Problem : Above code returns true even if this string does not exist
Please assist me.
According to findstr's help:
/C:string Uses specified string as a literal search string.
So try with a colon after /c like this:
findstr /c:"Auto Install is completed" "test.txt"
If you don't do this it simply ignores the /c.
There's absolutely no need to use FindStr for a basic string search, when Find can do the job perfectly well:
Find /I "Auto Install is completed"<"file.json">Nul&&(Set "validJSONData=0"
Echo ERROR:Auto Install is completed!)

Findstr giving access denied error

Why is this findstr command giving me access denied?
It does with admin or standard run of cmd. and should be able to write to the folder it not a root or protected directory
findstr /v /c:"dataremove1" Users.twml > Users.tmp
inside Users.twml is
datakeep1
datakeep2
datakeep3
dataremove1
datakeep4
datakeep5
What i want is if dataremove1 is found in the file, "delete" it by taking it out and making a new file without it in. if there is another easier way with batch what would that be also.
#### Edit Below ####
Chaging .tmp to .twmll the command works
findstr /v /c:"dataremove1" Users.twml > Users.twmll
Apparently .tmp is reserved for system level use only and not even admin can use it. changing to a different extension it works as it should.
Case closed.

I am trying to write a batch file to go through a list of computers search for Adobe Flash and return the PC name and version of Flash

This works to pull the version of Adobe but I cant seem to figure out how to get the host name display next to the Adobe version number.
PSINFO #C:\vulns.txt /s | find /I "Adobe Flash Player" >> Results.txt
I tried:
PSINFO #C:\vulns.txt /s | find /I "System Information for \\","Adobe Flash Player" >> Results.txt with no luck.
I think it needs to be done using a for command echoing the %Hostname% just not sure if that is right or how to do it. Please help I have 191 workstations I have to go through and find out which ones are on outdated version of Flash Player.

How do I not echo WMIC in a batch file

I am running the below command as part of a logon script, and would like to make sure the result isn't echoed:
wmic qfe | find "3033929"
I tried placing an # before the line but don't really know what else to try.
Thanks
Prefixing with # tells cmd not to echo the command before executing it.
wmic qfe | find "3033929" >nul
sends the output of the find to nowhere. errorlevel will still be set (0=found, non-0=not found)
You can use the below option for wmic to suppress output from wmic
wmic /output:CLIPBOARD qfe
But then your find would not work since it won't get any input.
I think you need to re-direct the output of the whole command as shown below to a file so that nothing is echoed to the screen/console
wmic qfe | find "3033929" > wmic.out
You can then look at wmic.out for the results

Ignore attrib Attribute error

How can I ignore the attribute error I get when I issue this command?
attrib -r D:\deploy\A_qa\Sample1\*.* /S /D
I've encountered an "access denied" error issue, because I'm unable to change one file attribute.
My question is, how can I ignore it, so that the error message isn't displayed? I've tried hiding the file, but unfortunately the error still persists.
Redirect the output so you won't see it:
attrib -r D:\deploy\A_qa\Sample1\*.* /S /D > nul

Resources