mskmsiva Posted January 18, 2012 Share Posted January 18, 2012 Hi all,All I want to do is to bring an application on top as focussed and the only active window using VBScript Link to comment Share on other sites More sharing options...
gunsmokingman Posted January 18, 2012 Share Posted January 18, 2012 Could you provide more infomation about what you want.Here is a Vbs Script that uses AppActivate and SendKeys Method 1:\ Open Notepad2:\ Add Some Text 3:\ Save And Closes the new Text flle AppActivate And Sending Keystrokes to a ProgramSave As Demo_SendKey.vbsDim 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 500Rename Demo_SendKey.vbs.txt to Demo_SendKey.vbs to make active.Demo_SendKey.vbs.txt Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now