Problem running script using Vista



Hi,
I'm trying to run a script on Vista that's similar to the one
below. For some reason, the script gets stuck in the Loop even though
an "Untitled - Notepad" window exists. The script worked fine in
Windows 2000 and XP. If I remove the loop and increase the sleep time
I can get it to work on Vista but I don't like this workaround. Does
anyone have any better ideas?

Set objFSO=CreateObject("Scripting.FileSystemObject")
Set objShell = WScript.CreateObject("WScript.Shell")

titleBar="Untitled - Notepad"

Do Until Success = True
Success = objShell.AppActivate(titleBar,3)
Wscript.Sleep 700
Wscript.Echo "Success=" & Success 'Debug statement
Loop

'Close the Notepad session
objShell.SendKeys "%( C)"


Thanks!!

.



Relevant Pages

  • Re: Problem running script using Vista
    ... I don't have Vista, so I don't know if what I am going to say will help ... the script gets stuck in the Loop even though ... Set objShell = WScript.CreateObject ... Do Until Success = True ...
    (microsoft.public.scripting.wsh)
  • Re: Report in FM 6 or 7
    ... achieve this report format will have to be done via scripting. ... but they will simplify the script and Sort Order. ... End Loop ... The normal 'Dancer' field is used so that if there are more than one ...
    (comp.databases.filemaker)
  • Re: recreate database script not work
    ... I got a script which is supposed to regenerate database systax. ... REM gen_dbse_9.sql ... end loop; ...
    (comp.databases.oracle.server)
  • Re: Vista Logon Script
    ... I cannot possibly deploy Vista until this is fixed either. ... are some scripts like 'Map network drives' that would need to be run in UAP ... In order to launch such scripts in a UAP context from an elevated ... Here is a sample script: ...
    (microsoft.public.scripting.wsh)
  • Re: Writing my 1st VBS "Script Component"
    ... source object is vacated; I always vacate the drived object first. ... In script, though, MS has tried to make it very ... And it's 3.3 product cycles for their Software Assurance racket. ... but it's supported in Vista. ...
    (microsoft.public.scripting.vbscript)