Jump to content

Can't run from parameter being read from registry


Go to solution Solved by Jos,

Recommended Posts

I am  trying to automate email settings for our mailserver for outlook clients..
Since our users use various office versions.. the only way i can get installation path is by reading from this registry :

From there i usually just fire up MLCFG32.CPL for adding email accounts..
But somehow the Run / RunWait never bring up the window ( manually run from command prompt window does, of course ).

Here is my simple lines :

$Officepath = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\OUTLOOK.EXE", "Path")
$cpl = 'MLCFG32.exe'
MsgBox (0, "OFFICE PATH", '"C:\Windows\System32\control.exe ' & $Officepath & '' & $cpl &'"')
Run ('"C:\Windows\System32\control.exe ' & $Officepath & '' & $cpl &'"')

 

The Messagebox correctly showing the complete command to be run...
but when i put it in Run() on the next line.. nothing happened.

Many thanks for the help..
 

Link to post
Share on other sites

Could be redirection issue.  Search forum for that.  Or try running x64.  In any case, you should put some error handling to understand why a statement does not work as expected.

Link to post
Share on other sites
  • Developers
  • Solution

There are several issues with the script....  like this one: ;) 

$cpl = 'MLCFG32.exe'

This works for me:

$Officepath = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\OUTLOOK.EXE", "Path")
$cpl = 'MLCFG32.cpl'
Run ('"C:\Windows\System32\control.exe" "' & $Officepath & $cpl & '"')

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

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
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...