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.
> 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
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
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!
> 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"""