Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Vista Newsgroups > Vista General

Vista - Vista and VBScript

Reply
 
Old 12-22-2006   #1 (permalink)
dak


 
 

Vista and VBScript

VBScript seems to run differently on Vista than on XP. Here is a little
VBscript to launch the Security Center on Windows. When run on XP, the
security center appears and the "Done" message does not appear until the
security center is closed. On Vista the "Done" message appears and then the
security center appears. Is this working as designed? If so, can I change the
default behavior?

--------------------------------
' launch security center
Option Explicit
On Error Resume Next

Dim objShell
Dim nReturnCode, fname

'
' Start the security center control panel
'
Set objShell = WScript.CreateObject("WScript.Shell")
fname = "%ComSpec% /C " + WScript.Path + "\wscui.cpl"
nReturnCode = objShell.Run(fname, 0, TRUE)

msgbox "done"
--------------------------------------


My System SpecsSystem Spec
Old 12-22-2006   #2 (permalink)
Alexander Suhovey


 
 

Re: Vista and VBScript

This problem seems to be related rather to the way control.exe works on
Vista than to VBScript. You should see what I mean if you run following
command at command prompt under both operating systems:

start /wait wscui.cpl

In Windows XP cmd will wait for Security Center to close while in Vista
abovementioned command exits immediately.

If you ask me I'd call it a bug. If it is not a documented change of course.

--
Alexander Suhovey


"dak" <dak@discussions.microsoft.com> wrote in message
news:931D6AE4-5906-48D0-B319-91B10EFAC63D@microsoft.com...
> VBScript seems to run differently on Vista than on XP. Here is a little
> VBscript to launch the Security Center on Windows. When run on XP, the
> security center appears and the "Done" message does not appear until the
> security center is closed. On Vista the "Done" message appears and then
> the
> security center appears. Is this working as designed? If so, can I change
> the
> default behavior?
>
> --------------------------------
> ' launch security center
> Option Explicit
> On Error Resume Next
>
> Dim objShell
> Dim nReturnCode, fname
>
> '
> ' Start the security center control panel
> '
> Set objShell = WScript.CreateObject("WScript.Shell")
> fname = "%ComSpec% /C " + WScript.Path + "\wscui.cpl"
> nReturnCode = objShell.Run(fname, 0, TRUE)
>
> msgbox "done"
> --------------------------------------
>


My System SpecsSystem Spec
Old 12-22-2006   #3 (permalink)
dak


 
 

Re: Vista and VBScript

Yes, I do see what you mean. I agree it could be a bug. Somethings work as
expected on Vista: "start /wait notepad.exe" does indeed wait, while: "start
/wait iexplore.exe" does not wait.

"Alexander Suhovey" wrote:

> This problem seems to be related rather to the way control.exe works on
> Vista than to VBScript. You should see what I mean if you run following
> command at command prompt under both operating systems:
>
> start /wait wscui.cpl
>
> In Windows XP cmd will wait for Security Center to close while in Vista
> abovementioned command exits immediately.
>
> If you ask me I'd call it a bug. If it is not a documented change of course.
>
> --
> Alexander Suhovey
>
>
> "dak" <dak@discussions.microsoft.com> wrote in message
> news:931D6AE4-5906-48D0-B319-91B10EFAC63D@microsoft.com...
> > VBScript seems to run differently on Vista than on XP. Here is a little
> > VBscript to launch the Security Center on Windows. When run on XP, the
> > security center appears and the "Done" message does not appear until the
> > security center is closed. On Vista the "Done" message appears and then
> > the
> > security center appears. Is this working as designed? If so, can I change
> > the
> > default behavior?
> >
> > --------------------------------
> > ' launch security center
> > Option Explicit
> > On Error Resume Next
> >
> > Dim objShell
> > Dim nReturnCode, fname
> >
> > '
> > ' Start the security center control panel
> > '
> > Set objShell = WScript.CreateObject("WScript.Shell")
> > fname = "%ComSpec% /C " + WScript.Path + "\wscui.cpl"
> > nReturnCode = objShell.Run(fname, 0, TRUE)
> >
> > msgbox "done"
> > --------------------------------------
> >

>
>

My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
VBScript works on XP but Vista VB Script
how to use the Common Item Dialog from vista in VBscript VB Script
How to do No hang up VBScript (nohup for VBScript) VB Script
Permission Denied in Vista with vbscript VB Script
What's Up With Vbscript.dll and Vista? Vista General


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46