Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

WMI + Outlook + mlcfg32.cpl

40 views
Skip to first unread message

Kamlesh Ghelani

unread,
Jan 25, 2004, 3:10:48 PM1/25/04
to
This command when run from the Start - Run prompt works fine and open the
CPL.

C:\Program Files\Common Files\System\Mapi\1033\mlcfg32.cpl

Yet when run using WMI

WSHELL.RUN "C:\Program Files\Common Files\System\Mapi\1033\mlcfg32.cpl"

The operating system responds that the file can not be found.

Can any one advise how I can achieve this using WMI.

As I am trying to automate Outlook 2000 profiles.


Torgeir Bakken (MVP)

unread,
Jan 25, 2004, 3:26:33 PM1/25/04
to
Kamlesh Ghelani wrote:

> This command when run from the Start - Run prompt works fine and open the
> CPL.
>
> C:\Program Files\Common Files\System\Mapi\1033\mlcfg32.cpl
>
> Yet when run using WMI
>
> WSHELL.RUN "C:\Program Files\Common Files\System\Mapi\1033\mlcfg32.cpl"

Hi

Note: The line above is not using WMI, just plain VBScript/WSH

Because the path has spaces in it, you need to put quotes around it like this:

WSHELL.RUN """C:\Program Files\Common Files\System\Mapi\1033\mlcfg32.cpl"""

(to get one quote inside a quoted string, you need to use two quotes to get
one effective)

--
torgeir
Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of the 1328 page
Scripting Guide: http://www.microsoft.com/technet/scriptcenter


Michael Holzemer

unread,
Jan 25, 2004, 3:59:50 PM1/25/04
to

This is not WMI it is WSH. The problem is the space between Program and
Files so you need to put quotes around the string. The "" puts the quote
into the string so the below command will look like
Control "C:\Program Files\Common Files\System\Mapi\1033\mlcfg32.cpl". In
addition you will need the control executable and pass the .cpl file as an
argument.

wshell.run "Control ""C:\Program Files\Common


Files\System\Mapi\1033\mlcfg32.cpl"""

--
Regards,

Michael Holzemer
No email replies please - reply in newsgroup

Learn script faster by searching here
http://www.microsoft.com/technet/treeview/default.asp?url=/technet/scriptcenter/default.asp


Hinesh ghelani

unread,
Jan 26, 2004, 5:59:52 AM1/26/04
to

Hello, thank you for your response, however have tried your suggestion

WSHELL.RUN """C:\Program Files\Common
Files\System\Mapi\1033\mlcfg32.cpl"""

but I am still getting the same error, any hints please


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Torgeir Bakken (MVP)

unread,
Jan 26, 2004, 7:57:22 AM1/26/04
to
Hinesh ghelani wrote:

> Hello, thank you for your response, however have tried your suggestion
>
> WSHELL.RUN """C:\Program Files\Common
> Files\System\Mapi\1033\mlcfg32.cpl"""
>
> but I am still getting the same error, any hints please

Hi

As Michael Holzemer posted in this thread, you will need to add Control.exe as
well to launch the cpl file:

WSHELL.RUN "Control.exe ""C:\Program Files\Common


Files\System\Mapi\1033\mlcfg32.cpl"""

0 new messages