PDA

View Full Version : Task Automation



GRL
03-20-2001, 09:53 PM
New to WSH and am wondering whether this can solve my problem. I have an encryption app installed under NT on a server machine. I am attempting to automate the tasks of encryption and decyption so that no user intervention is required. I have been investigating 2 alternatives with the product for automation. 1) The encryption package has a command line feature. However, execution at the command line still prompts for a password. Is there a way to write a script that will execute my command line encryption exe and then provide the password? 2) The encryption package has another program that when running provides for a mechanism that allows for interaction with a folder. Basically files dropped into the folder will be encrypted and upon exiting the program files in the folder can be decrypted. Is there a way to cause an "EXIT" from an active program?

RWSchlatter
03-25-2001, 11:50 PM
check the SendKeys method !

to terminate an application send it the key sequence ALT+F4.

Sample code copied from Microsofts WSH help file:
<pre>&lt;package&gt;
&lt;job id="vbs"&gt;
&lt;script language="VBScript"&gt;
set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run "calc"
WScript.Sleep 100
WshShell.AppActivate "Calculator"
WScript.Sleep 100
WshShell.SendKeys "1{+}"
WScript.Sleep 500
WshShell.SendKeys "2"
WScript.Sleep 500
WshShell.SendKeys "~"
WScript.Sleep 500
WshShell.SendKeys "*3"
WScript.Sleep 500
WshShell.SendKeys "~"
WScript.Sleep 2500
&lt;/script&gt;
&lt;/job&gt;
&lt;/package&gt;[]/pre

______________
Regards - Richard