jscpu 发表于 2011-2-10 13:27:30

regsvr32无法注册@CommonFilesDir目录下的文件

ShellExecute("regsvr32",@CommonFilesDir & "\core.dll")


提示
loadlibrary(c:\program")失败 - 找不到指定的模块

jscpu 发表于 2011-2-10 14:10:43

有人知道是咋回事么?

kevinch 发表于 2011-2-10 15:00:14

两个尝试:
1.
试一下
ShellExecute("regsvr32","""" & @CommonFilesDir & "\core.dll""")

2.
试一下用命令行命令:
run("cmd.exe /c regsvr32 /s """ & @CommonFilesDir & "\core.dll""")

jscpu 发表于 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

easied 发表于 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)

easied 发表于 2011-2-15 02:53:01

话说回来,看了3楼的""""我才知道原来双引号可以这么用,真晕
页: [1]
查看完整版本: regsvr32无法注册@CommonFilesDir目录下的文件