找回密码
 加入
搜索
查看: 2848|回复: 6

[AU3基础] regsvr32无法注册@CommonFilesDir目录下的文件

[复制链接]
发表于 2011-2-10 13:27:30 | 显示全部楼层 |阅读模式
ShellExecute("regsvr32",@CommonFilesDir & "\core.dll")


提示
loadlibrary(c:\program")失败 - 找不到指定的模块
 楼主| 发表于 2011-2-10 14:10:43 | 显示全部楼层
有人知道是咋回事么?
发表于 2011-2-10 15:00:14 | 显示全部楼层
两个尝试:
1.
试一下
ShellExecute("regsvr32","""" & @CommonFilesDir & "\core.dll""")

2.
试一下用命令行命令:
run("cmd.exe /c regsvr32 /s """ & @CommonFilesDir & "\core.dll""")
 楼主| 发表于 2011-2-10 21:24:11 | 显示全部楼层
本帖最后由 jscpu 于 2011-2-10 21:31 编辑

回复 3# kevinch

谢谢楼上的 用你的第一个方法
但是要是加参数怎么加呢?
/U   想卸载它,我试了几个位置都不对!
发表于 2011-2-15 00:29:48 | 显示全部楼层
回复 4# jscpu


    我是引用3楼的第二种方法
   run("cmd.exe /c regsvr32 /u """ & @CommonFilesDir & "\core.dll""")
     帮regsvr32后面的/S 改为/U
发表于 2011-2-15 02:46:03 | 显示全部楼层
又一个字符串连接没学好的.
你这个问题是因为路径包含了空格导致的,需要使用引号把路径包括起来.
Local $sProgram     = "regsvr32.exe"
Local $sParameter   = "/s" & " " & '"' & @CommonFilesDir & "\core.dll" & '"'
Local $sCommandLine = $sProgram &" "& $sParameter
MsgBox(4096, "命令行", $sCommandLine)
Run($sCommandLine)
发表于 2011-2-15 02:53:01 | 显示全部楼层
话说回来,看了3楼的""""我才知道原来双引号可以这么用,真晕
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-9-21 13:30 , Processed in 0.078023 second(s), 23 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表