[AccessD] A2K: Regsvr32 assistance please

Gustav Brock gustav at cactus.dk
Wed Oct 22 09:11:39 CDT 2003


Hi Darren

First, note the windir of Win9x and WinXP typically is C:\Windows, not
C:\WINNT.

Second, for long filenames, you probably need to add quotes before
passing the command line to Shell():

strCmd = Chr(34) & "C:\Winnt\System32\regsvr.exe" & Chr(34) & " " &
Chr(34) & "C:\Winnt\system32\comctl32.ocx" & Chr(34)

or, for short filenames, you may not need them:

strCmd = "C:\Winnt\System32\regsvr.exe" & " " &
"C:\Winnt\system32\comctl32.ocx"

Then adjust your Shell() syntax:

lngReturn = Shell(strCmd, vbNormalFocus)

/gustav


> I just want to set a quick and dirty bit of code to register an ocx
> I know about shell and how to get it to work. 
> I also know about regsvr and how to get it to work 

> Problem is RegSvr accepts command line parameters and I can't get it 
> and shell to work together on the same line 
> I need to get something like the following to work (pseudo code)... 

> Shell("C:\Winnt\System32\regsvr.exe",1) "C:\Winnt\system32\comctl32.ocx" 



More information about the AccessD mailing list