Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Does a VB script effect focus if it does not have SendKey commands

Posted on 2011-02-17
3
Medium Priority
?
529 Views
Last Modified: 2012-05-11
I am running an AutoIT script that sometimes sends simulated keyboard strokes to a running WIN7 program.  It does just fine until I also run some VB scripts in the background, then some of the keystrokes seem to be ignored.  The VB scripts do not have any keystroke commands (doing FTP, moving files from folder to folder,  ZIPing).  Do VB scripts with no key commands intefere with or take control of focus while running?
0
Comment
Question by:Mike Caldwell
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 65

Accepted Solution

by:
RobSampson earned 2000 total points
ID: 34921089
No, they shouldn't, if it's running via wscript.exe, whereas cscript.exe will show a DOS prompt, and will take the focus.  It's not so much SendKeys that changes any focus, it's more things like
objShell.AppActivate "windowtitle"

that would change the focus.

However, if your AutoIT isn't trying to change the focus to whatever it's sending keystrokes to, then performing any other task while that is running will change the focus and the AutoIT keystrokes will go to that object.

Therefore, double-clicking the VBS might change the focus onto the VBS file itself, but not the script during execution.

Regards,

Rob.
0
 
LVL 1

Author Comment

by:Mike Caldwell
ID: 34921736
Thanks Rob.  The VB stuff is not CS, and they run continuously.  So with that I am puzzled why the WIN7 application being controlled by AutoIT seems to run fine while soso, but when the VB scripts are run at the same time some keystrokes to the app seem to get lost.  I start the VB stuff first, then AutoIT.
0
 
LVL 65

Expert Comment

by:RobSampson
ID: 34921960
Is your AutoIT script activating the windows it is supposed to send keystrokes to?  It should be, just to safeguard.

Is your VBScript doing anything file system wise, or system setting wise, that might cause a refresh in Windows 7?  Since Windows 7 automatically continuously refreshes folder views, it could be as simple as adding a new file somewhere that might cause it to refresh, but I'm not sure.

Rob.
0

Featured Post

Enroll in September's Course of the Month

This month’s featured course covers 16 hours of training in installation, management, and deployment of VMware vSphere virtualization environments. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article we want to have a look at the directory attributes which are used by Microsoft to store the so called Security Identifiers (SID). These SIDs plays an important role in delegating and granting permissions and in authentication of trus…
I met Paul Devereux (@pdevereux) today when I responded to his tweet asking “Anybody know how to automate adding files from disk to a folder in #outlook  ?”.  I replied back and told Paul that using automation, in this case scripting, to add files t…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…

670 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question