![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| 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. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | 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 Specs![]() |
| | #2 (permalink) |
| | 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 Specs![]() |
| | #3 (permalink) |
| | 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 Specs![]() |
![]() |
| 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 | |||