Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SendKeys Security and Guidance Required

Status
Not open for further replies.

mpvsystems

Programmer
Jan 21, 2008
1
CA
Hello,
I have a small vb script - running in cscript - that opens an ERP application window and then unfortunately requires the use of SendKeys to simulate keystrokes in its GUI to launch a batch process. The application is part of an older ERP system that does not provide an API through which to call its functions directly. The script runs on a network admin PC dedicated for scripts and other utilities; its O/S is Windows XP SP2. The application exe being controlled with SendKeys is installed on a network file server and the database runs on an Oracle server. I use the local PC's Windows AT scheduler to run the script on a nightly basis.
The script runs properly when a logged in user launches it directly or triggers it through the scheduler but it stops at the first SendKeys instruction when running autonomously.

Thus far I have read various comments that advise that SendKeys only work with the "Default" desktop and that services such as the built-in AT scheduler must be run under the Local System account with the "Allow Interactive" switch set to True for this to occur. There is also the complication of Services running under the Local System account having no access to shared resources - such as application exes installed on network servers.

Despite my efforts to set up the AT scheduler and script to run under the Local System account SendKeys still appears to be 'hanging'. When I log to check the script status after the scheduled start time has long since passed I find both the application exe and cscript open in Task Manager but neither the batch process nor its log file have initialized by the SendKeys instructions.

Thanks in advance for you advice and support.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top