zoukankan      html  css  js  c++  java
  • 【技术贴】ActiveX 部件不能创建对象 Wscript.Shell,右键打开所在目录的批处理ba

    1. 开始 -- 运行 -- 输入regsvr32 %windir%\system32\WSHom.Ocx 回车

    2. 开始 -- 运行 -- 输入regsvr32 /u scrrun.dll 回车

    3. 以上两步即可解决此问题。没有为什么,微软说的。

      

      同时奉献两个最好用的右键打开所在目录的批处理文件,提供卸载。

      下载地址  http://ishare.iask.sina.com.cn/f/33339403.html

       --------------------------------------------安装.bat--------------------------

    @echo off
    color 0A
    title 开启右键打开快捷方式所在目录成功......
    mode con cols=40 lines=10
    echo set args = WScript.Arguments>>C:\WINDOWS\system32\open_shrtct_parent_folder.vbs
    echo linkname = args(0)>>C:\WINDOWS\system32\open_shrtct_parent_folder.vbs
    echo. >>C:\WINDOWS\system32\open_shrtct_parent_folder.vbs
    echo set wshshell = CreateObject("WScript.Shell")>>C:\WINDOWS\system32\open_shrtct_parent_folder.vbs
    echo. >>C:\WINDOWS\system32\open_shrtct_parent_folder.vbs
    echo set scut = wshshell.CreateShortcut(linkname)>>C:\WINDOWS\system32\open_shrtct_parent_folder.vbs
    echo. >>C:\WINDOWS\system32\open_shrtct_parent_folder.vbs
    echo set fs = CreateObject("Scripting.FileSystemObject")>>C:\WINDOWS\system32\open_shrtct_parent_folder.vbs
    echo. >>C:\WINDOWS\system32\open_shrtct_parent_folder.vbs
    echo folder = """" ^& fs.GetParentFolderName(scut.TargetPath) ^& """">>C:\WINDOWS\system32\open_shrtct_parent_folder.vbs
    echo. >>C:\WINDOWS\system32\open_shrtct_parent_folder.vbs
    echo wshshell.Run(folder)>>C:\WINDOWS\system32\open_shrtct_parent_folder.vbs

    if exist "tmp.reg" del "tmp.reg"
    echo Windows Registry Editor Version 5.00>>tmp.reg
    echo. >>tmp.reg
    echo [HKEY_CLASSES_ROOT\lnkfile\shell]>>tmp.reg
    echo. >>tmp.reg
    echo [HKEY_CLASSES_ROOT\lnkfile\shell\打开所在目录]>>tmp.reg
    echo. >>tmp.reg
    echo [HKEY_CLASSES_ROOT\lnkfile\shell\打开所在目录\command]>>tmp.reg
    echo @="wscript.exe \"C:\\windows\\system32\\open_shrtct_parent_folder.vbs\" \"%%%L\"">>tmp.reg
    echo. >>tmp.reg 
    regedit /s "tmp.reg" >nul 2>nul
    del "tmp.reg"

    echo.
    echo.
    echo.
    echo.
    echo.      【开启成功,任意键退出】 
    pause>nul 
    exit

    -----你懂得怎么用的。(以上内容复制进txt并重命名为xx.bat双击即可。)------------- 

    --------------------------------------------- 卸载.bat--------------------------------------

    @echo off
    color 0A
    mode con cols=40 lines=10
    title 关闭右键打开快捷方式所在目录成功......
    reg delete HKEY_CLASSES_ROOT\lnkfile\shell /f
    del C:\WINDOWS\system32\open_shrtct_parent_folder.vbs

    echo.
    echo.
    echo.
    echo.       【按任意键退出】 
    pause>nul 
    exit

    ---------------------------------------你懂得怎么用的。------------------------------------------

    之所以出现这个帖子就是因为这个错误的出现,使得这两个bat文件操作后,不能打开所在目录,所以运行了开头的那两个步骤后,一切完美。

     下载地址  http://ishare.iask.sina.com.cn/f/33339403.html

  • 相关阅读:
    Max History CodeForces
    Buy a Ticket CodeForces
    AC日记——字符串的展开 openjudge 1.7 35
    AC日记——回文子串 openjudge 1.7 34
    AC日记——判断字符串是否为回文 openjudge 1.7 33
    AC日记——行程长度编码 openjudge 1.7 32
    AC日记——字符串P型编码 openjudge 1.7 31
    AC日记——字符环 openjudge 1.7 30
    AC日记——ISBN号码 openjudge 1.7 29
    AC日记——单词倒排 1.7 28
  • 原文地址:https://www.cnblogs.com/ae6623/p/4416702.html
Copyright © 2011-2022 走看看