Is it a bug ?

S

Someone

Hi

When i run this vbs script :

Set WshShell = WScript.CreateObject("WScript.Shell")
set objFS = CreateObject("Scripting.FileSystemObject")
Return = WshShell.Run("notepad ", 1, true)
return = wshShell.Run ("explorer.exe ", 1, true)
return = wshShell.Run ("regedit ", 1, true)

Why doesn't the script correctly runs ? it should run regedit only after
explorer is closed, but it runs both.
It's XPe with SP1.

Any idea ?
Thanks in adavnce for any help

Jorge
 
M

Martin Grossen, eMVP [AVNET Silica]

Hi Jorge

It's not a bug.... it's a feature!
:)

explorer is part of the main shell and is allways open.
So, it will open the regedit imediately.
Extend your script with a notepad again, and
you will see the correct way...
So, don't start explorer direct.
btw: you can't close explorer.exe....
it's the shell!



--

Martin Grossen, eMVP

AVNET EMG Silica
Franchise Manager Microsoft Embedded Europe

Your competent partner for Microsoft Embedded licencing

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top