Hi all,
All I want to do is to bring an application on top as focussed and the only active window using VBScript
Page 1 of 1
How to bring an application to bring on top (focus) and active Application - active and on top of other windows (Using VBS)
#2
Posted 18 January 2012 - 01:13 PM
Could you provide more infomation about what you want.
Here is a Vbs Script that uses AppActivate and SendKeys Method
1:\ Open Notepad
2:\ Add Some Text
3:\ Save And Closes the new Text flle
AppActivate And Sending Keystrokes to a Program
Save As Demo_SendKey.vbs
Rename Demo_SendKey.vbs.txt to Demo_SendKey.vbs to make active.
Demo_SendKey.vbs.txt (1.01K)
Number of downloads: 1
Here is a Vbs Script that uses AppActivate and SendKeys Method
1:\ Open Notepad
2:\ Add Some Text
3:\ Save And Closes the new Text flle
AppActivate And Sending Keystrokes to a Program
Save As Demo_SendKey.vbs
Dim Act :Set Act = CreateObject("Wscript.Shell")
Act.Run("Notepad.exe"),1,False
Do Until Success = True
Success = Act.AppActivate("Notepad")
Wscript.Sleep 1000
Loop
Act.SendKeys "This is a test of AppActivate."
WScript.Sleep 1000
Act.SendKeys "{ENTER}"
Act.SendKeys "T" :WScript.Sleep 500
Act.SendKeys "e" :WScript.Sleep 500
Act.SendKeys "s" :WScript.Sleep 500
Act.SendKeys "t" :WScript.Sleep 500
Act.SendKeys "%F"
Act.SendKeys "{DOWN}" :WScript.Sleep 500
Act.SendKeys "{DOWN}" :WScript.Sleep 500
Act.SendKeys "{DOWN}" :WScript.Sleep 500
Act.SendKeys "{ENTER}" :WScript.Sleep 500
Act.SendKeys "Demo_Send_Key.txt"
Act.SendKeys "{ENTER}",500
Act.SendKeys "%F" :WScript.Sleep 1000
Act.SendKeys "{DOWN}" :WScript.Sleep 500
Act.SendKeys "{DOWN}" :WScript.Sleep 500
Act.SendKeys "{DOWN}" :WScript.Sleep 500
Act.SendKeys "{DOWN}" :WScript.Sleep 500
Act.SendKeys "{DOWN}" :WScript.Sleep 500
Act.SendKeys "{DOWN}" :WScript.Sleep 500
Act.SendKeys "{ENTER}" :WScript.Sleep 500
Rename Demo_SendKey.vbs.txt to Demo_SendKey.vbs to make active.
Demo_SendKey.vbs.txt (1.01K)
Number of downloads: 1
- ← Visual Source Safe 6.0 fails to load
- Programming (C++, Delphi, VB/VBS, CMD/batch, etc.)
- Scripting for configuration on router →
Share this topic:
Page 1 of 1



Help
Back to top









