Sign in to follow this  
Followers 0
Robin

Error -->RunWait with Regsvr32.exe and &var

4 posts in this topic

Here is a small script that i'm trying to do but i have a feeling it's not working...If i use it on a ".BAT" file it even sais its registered...and THAT I know is undoubtfully incorrect...I'm trying to let the customer "search" for a file to be registered

:mellow:

=================================================================

#include <File.au3>

$message = "Hold down Ctrl or Shift to choose multiple files."

$var = FileOpenDialog($message, @HomeDrive & "", "All (*.dll;*.ocx)|(*.*)", 1 + 4)

$var2 = Runwait("regsvr32.exe",$var)

If $var2 = 0 Then

MsgBox(0, "Registered", $var , " Successfully Registered...")

Else

MsgBox(0, "Error", "...No Files")

EndIf

==================================================================

...would realy like some help on this please fellas as i have no idea if the file WAS registered or not :(

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

#include <File.au3>
$message = "Hold down Ctrl or Shift to choose multiple files."

$var = FileOpenDialog($message, @HomeDrive & "", "All (*.dll;*.ocx)|(*.*)", 1 + 4)
If @error Then Exit ; User clicked cancel

$var2 = Runwait('regsvr32.exe "' & $var & '"')

If $var2 = 0 Then
    MsgBox(0, "Registered", $var , " Successfully Registered...")
Else
    MsgBox(0, "Error", "...No Files")
EndIf

Edited by Manadar

Share this post


Link to post
Share on other sites

#include <File.au3>
$message = "Hold down Ctrl or Shift to choose multiple files."

$var = FileOpenDialog($message, @HomeDrive & "", "All (*.dll;*.ocx)|(*.*)", 1 + 4)
If @error Then Exit ; User clicked cancel

$var2 = Runwait('regsvr32.exe "' & $var & '"')

If $var2 = 0 Then
    MsgBox(0, "Registered", $var , " Successfully Registered...")
Else
    MsgBox(0, "Error", "...No Files")
EndIf
Thx Manadar...i see i made the error with the freakin "&" s..... and (') s....

Share this post


Link to post
Share on other sites

Thx Manadar...i see i made the error with the freakin "&" s..... and (') s....

You were passing the DLL to add as a "working folder" parameter to Run. A common mistake, other languages sometimes pass arguments to a Run as seperate parameters..

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0