Problem running script using Vista
- From: dsouzam@xxxxxxxxxxxx
- Date: 10 Jan 2007 12:02:11 -0800
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!!
.
- Follow-Ups:
- Re: Problem running script using Vista
- From: Tom Lavedas
- Re: Problem running script using Vista
- Prev by Date: Re: Vista UAC problem with WScript.Shell Run method
- Next by Date: Re: Read Shortcut
- Previous by thread: Re: Script output options...
- Next by thread: Re: Problem running script using Vista
- Index(es):
Relevant Pages
|