从批处理文件的Internet Explorer 11的检测 [英] Internet Explorer 11 detection from Batch File

查看:169
本文介绍了从批处理文件的Internet Explorer 11的检测的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想问问你,如果有一个批处理文件的方式来做到以下几点:

I would like to ask you if there is a way in a batch file to do the following:

1)读Internet Explorer版本从注册表。

1) Read Internet explorer version from the registry.

2)如果Internet Explorer小于11版弹出一个消息,然后退出应用程序后,pressing按钮您运行的是不同版本的Internet Explorer的应用将关闭。

2) If internet explorer is less than version 11 pop up a message "you are running a different version of Internet explorer. Application will close" and then exit application after pressing a button;

3)如果Internet Explorer 11或更高,然后弹出消息您正在运行Internet Explorer 11或更高版本;

3) If internet explorer is 11 or higher then pop up message "You are running Internet explorer 11 or higher";

一个.reg文件将随后从C导入:\\ myfolder然后再批量文件应该出现类似。做完手术preSS一键关闭窗口

A Reg file will then be imported from c:\myfolder and then batch file should show up something like "Operation finished.Press one button to close window".

我知道IE在以下路径11个地方叫svcVersion蜂巢

I know IE 11 places a hive called "svcVersion" in the following path

HKEY_LOCAL_MACHINE \\ SOFTWARE \\微软\\的Internet Explorer

"HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer

我不知道是否有任何你可能会帮助我如何指导的批处理文件,从注册表中查找该参数读取,然后做如上。
非常感谢你确实对你有所帮助。
Meleena

I wonder if any of you might be help me how to "instruct" the batch file to read from the registry looking for that parameter and then do as above. Thank you very much indeed for your help. Meleena

推荐答案

这应该这样做:

@echo off
setlocal
cd /d %~dp0
set regquery=reg query "HKLM\Software\Microsoft\Internet Explorer" /v svcVersion
for /f "tokens=3" %%a in ('%regquery%') do (
  for /f "tokens=1 delims=." %%b in ("%%a") do (
    if %%b LSS 11 echo you are running a different version of Internet explorer. Application will close & goto :eof
    if %%b GEQ 11 (
       echo You are running Internet explorer 11 or higher.
       echo REGEDIT /S C:\myfolder\myfile.reg
       echo Operation finished. Press any key to close window.
       pause>nul
    )
  )
)

注册表编辑器之前取出回声更改myfile.reg的正确名称后。

Remove the echo before regedit after you change myfile.reg the the correct name.

这篇关于从批处理文件的Internet Explorer 11的检测的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆