Jump to content

Run command


Recommended Posts

:D Help!

Can someone tell me why this script won't work? I am getting an error on the run command.

I am trying to launch an uninstall program by pulling the location out of the registry and then passing that value to a run command.

Any help would be greatly appricated! :D

$60Path = ("C:\Program Files\Adobe\Acrobat 6.0")
If FileExists($60Path) Then
    $60Reg = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Products\68AB67CA7DA73301B7440A0000000010\InstallProperties", "LocalPackage")
    Run($60Reg, "C:\WINDOWS\Installer",  @SW_MAXIMIZE)
Else
    MsgBox(4096, "", "Adobe Reader v6.0 does not exist")
EndIf
Exit

Thanks!

Link to comment
Share on other sites

:D Help!

Can someone tell me why this script won't work? I am getting an error on the run command.

I am trying to launch an uninstall program by pulling the location out of the registry and then passing that value to a run command.

Any help would be greatly appricated! :D

$60Path = ("C:\Program Files\Adobe\Acrobat 6.0")
If FileExists($60Path) Then
    $60Reg = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Products\68AB67CA7DA73301B7440A0000000010\InstallProperties", "LocalPackage")
    Run($60Reg, "C:\WINDOWS\Installer",  @SW_MAXIMIZE)
Else
    MsgBox(4096, "", "Adobe Reader v6.0 does not exist")
EndIf
Exit

Thanks!

not sure about the whole thing, but i think it doesn't work cause you cant have a variable start with a number,

just make it "$_60Path"

might not solve the problem, but could cause an issue

Link to comment
Share on other sites

  • Moderators

not sure about the whole thing, but i think it doesn't work cause you cant have a variable start with a number,

just make it "$_60Path"

might not solve the problem, but could cause an issue

Since when can't you have a variable start with a number? I think you mean a Function can't start with a number.

@HockeyFan

I don't now if the Run Command can run a .msi file like that directly. Was that your intention?

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

not sure about the whole thing, but i think it doesn't work cause you cant have a variable start with a number,

just make it "$_60Path"

might not solve the problem, but could cause an issue

I've done a test to see what value is returned...so I'm assuming that the variable works OK.

The test comes back with C:\WINDOWS\Installer\883e1.msi.

I thought that would be a valid entry to use in a run command.

Do I need to extract the program name "883e1.msi" and if so, how would I do that? :D

Link to comment
Share on other sites

I've done a test to see what value is returned...so I'm assuming that the variable works OK.

The test comes back with C:\WINDOWS\Installer\883e1.msi.

I thought that would be a valid entry to use in a run command.

Do I need to extract the program name "883e1.msi" and if so, how would I do that? :D

The error message states "Unable to execute the external program.

Does that help??

Link to comment
Share on other sites

Since when can't you have a variable start with a number? I think you mean a Function can't start with a number.

@HockeyFan

I don't now if the Run Command can run a .msi file like that directly. Was that your intention?

Oh... whooops :"> :">

my bad

yeah well i have an excuse though, its summer and my brain is fried :D:D , sorry about that, and function is definatley what i was thinking about

i need to think more before i post :P

Link to comment
Share on other sites

Since when can't you have a variable start with a number? I think you mean a Function can't start with a number.

@HockeyFan

I don't now if the Run Command can run a .msi file like that directly. Was that your intention?

Yes! I wanted to run an msi uninstall program.

Link to comment
Share on other sites

  • Moderators

Yes! I wanted to run an msi uninstall program.

Well I'm not a fan of hard coding things (Drives/paths) (I like to use macros), and Mine is 7.0.7 build, but I tested this and it seemed to work:
Run("msiexec /i " & $60Reg & " /qb")
Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

Well I'm not a fan of hard coding things (Drives/paths) (I like to use macros), and Mine is 7.0.7 build, but I tested this and it seemed to work:

Run("msiexec /i " & $60Reg & " /qb")
:D Thank you...that works!! I didn't get the error message and something happened. I just didn't get the uninstall screens like I did when I manually ran the msi program.

What does the /qb parameters stand for? Does that run the program in silent mode or something :D

Thanks for you help!

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...