Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


SendKeys and task Scheduler Problem

Posted on 2006-03-23
Medium Priority
Last Modified: 2012-06-27
Hello all I have a problem with a script that i wrote running in task scheduler.

if i am logged in and run it manually it works fine.
even through terminal services it works fine.

if i run it through a scheduleing program it is in a waiting state.  when i log in the cmd window is open and it is waiting for the sendkeys to work?  how can i get this to run properly

this is the command in the BATCH file i use to run the vb script:
wscript.exe //NoLogo decrypt.vbs | cmd.exe

Here is the acctual VBS file:
Wscript.Stdout.WriteLine "gpg --decrypt test.pgp > testout.txt"
CreateObject("WScript.Shell").SendKeys "test{ENTER}"
WScript.Sleep 5000

Question by:sanehpal
LVL 22

Accepted Solution

cookre earned 1000 total points
ID: 16277660

"When no one is logged on, there is no istance of Explorer (the Shell), no available desktop in WinSta0, and any attempt to open a window in the logon desktop and attaching to that message queue will fail."

Author Comment

ID: 16278116
I was hoping that someone has a suggestion on doing it another way.

Assisted Solution

nepostojeci_email earned 1000 total points
ID: 16278183
Write it as a service.

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

What do responsible coders do? They don't take detrimental shortcuts. They do take reasonable security precautions, create important automation, implement sufficient logging, fix things they break, and care about users.
If you are a mobile app developer and especially develop hybrid mobile apps then these 4 mistakes you must avoid for hybrid app development to be the more genuine app developer.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
Introduction to Processes

564 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