SendKeys and task Scheduler Problem

Posted on 2006-03-23
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 23

    Accepted Solution


    "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

    I was hoping that someone has a suggestion on doing it another way.
    LVL 8

    Assisted Solution

    Write it as a service.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    Fix45 challenge 15 66
    Python 2.7 - Passing arguments 8 30
    how to run a batch process 16 27
    Installed softare without GUID 6 26
    Displaying an arrayList in a listView using the default adapter is rarely the best solution. To get full control of your display data, and to be able to refresh it after editing, requires the use of a custom adapter.
    Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
    An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
    In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

    728 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

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now