HockeyFan Posted June 9, 2006 Share Posted June 9, 2006 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! $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 More sharing options...
Paulie Posted June 9, 2006 Share Posted June 9, 2006 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! $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 More sharing options...
Moderators SmOke_N Posted June 9, 2006 Moderators Share Posted June 9, 2006 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 issueSince when can't you have a variable start with a number? I think you mean a Function can't start with a number.@HockeyFanI 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 More sharing options...
HockeyFan Posted June 9, 2006 Author Share Posted June 9, 2006 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 issueI'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? Link to comment Share on other sites More sharing options...
HockeyFan Posted June 9, 2006 Author Share Posted June 9, 2006 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? The error message states "Unable to execute the external program.Does that help?? Link to comment Share on other sites More sharing options...
Paulie Posted June 9, 2006 Share Posted June 9, 2006 Since when can't you have a variable start with a number? I think you mean a Function can't start with a number.@HockeyFanI 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 , sorry about that, and function is definatley what i was thinking abouti need to think more before i post Link to comment Share on other sites More sharing options...
HockeyFan Posted June 9, 2006 Author Share Posted June 9, 2006 Since when can't you have a variable start with a number? I think you mean a Function can't start with a number.@HockeyFanI 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 More sharing options...
Moderators SmOke_N Posted June 9, 2006 Moderators Share Posted June 9, 2006 (edited) 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 June 9, 2006 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 More sharing options...
HockeyFan Posted June 9, 2006 Author Share Posted June 9, 2006 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") 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 Thanks for you help! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now