ccrockett1027
asked on
Using Task Scheduler to Open a VB Scrpit that opens a progam, and does a couple commands
Hello, I need help. I can run my VB Script while on the server and it performs. Just when i am trying to do it as a scheduled task it does not work. I have tried to create a batch file to put in Task Scheduler to run the script and no luck. Below is my vb script.
Set WSHshell=CreateObject("WSc ript.Shell ")
'open docstar client
WSHShell.Run "C:\docstar\dsclient.exe"
wscript.sleep (5000)
WSHShell.sendkeys "{enter}"
'This enters the username to login
WSHShell.sendkeys "username"
WSHShell.sendkeys "{enter}"
'This enters the Pasword to login
WSHShell.sendkeys "password"
WSHShell.sendkeys "{enter}"
wscript.sleep (5000)
'The rest below selects docs to file and auto files them
WSHShell.sendkeys "^f"
wscript.sleep (5000)
WSHShell.sendkeys "^a"
wscript.sleep (5000)
WSHShell.sendkeys "%f"
WSHShell.sendkeys "a"
wscript.sleep (5000)
WSHShell.sendkeys "{enter}"
wscript.sleep (5000)
WSHShell.sendkeys "{enter}"
Set WSHshell=CreateObject("WSc
'open docstar client
WSHShell.Run "C:\docstar\dsclient.exe"
wscript.sleep (5000)
WSHShell.sendkeys "{enter}"
'This enters the username to login
WSHShell.sendkeys "username"
WSHShell.sendkeys "{enter}"
'This enters the Pasword to login
WSHShell.sendkeys "password"
WSHShell.sendkeys "{enter}"
wscript.sleep (5000)
'The rest below selects docs to file and auto files them
WSHShell.sendkeys "^f"
wscript.sleep (5000)
WSHShell.sendkeys "^a"
wscript.sleep (5000)
WSHShell.sendkeys "%f"
WSHShell.sendkeys "a"
wscript.sleep (5000)
WSHShell.sendkeys "{enter}"
wscript.sleep (5000)
WSHShell.sendkeys "{enter}"
ASKER
I tried that and it did not work. I would run the task while being logged into the account that it is authenticating with. The only way the script would run is if i manually invoke (click) the script. Does anyone have a way that may be different than what i have done to get the same result?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
1
ASKER
Had to contact our software vendor. they helped us thru the process in there programming to do what i wanted with the script
However, if the Task is scheduled to occur when there is no Interactive Logon, it will fail, due to the use of the SendKeys method.