- /*&cls
- @echo off
- set "key=HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Products"
- for /f "delims=" %%a in ('reg query "%key%" /v DisplayName /s^|cscript -nologo -e:jscript "%~f0"') do set/an+=1&call set "#%%n%%=%%a"
- set #
- pause&exit
- */
- var text = WSH.StdIn.ReadAll(), s='',m;
- var str = 'Microsoft .NET Framework 4.5.2';
- var str = str.replace(/[.+$^\[\](){}]/g,'\\$&')
- var reg = new RegExp('(HKEY_.+?)\\n.+?\\S+?\\s+?'+str+'\s*([\\r\\n]|$)', 'g');
- while((m = reg.exec(text)) != null)s+=m[1]+'\r\n';
- WSH.echo(s);
复制代码
|